perm filename PUI2S.PUI[DOC,AIL] blob sn#206174 filedate 1976-03-09 generic text, type T, neo UTF8
1⎇⎇␈F1␈→1069⎇0⎇2⎇0⎇⎇␈F2SECTION  1␈F1␈←
2⎇⎇␈F1SAIL Addendum  1␈→1069⎇243⎇1⎇0⎇⎇INTRODUCTION␈←
3⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16409⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
4⎇⎇␈F1␈→978⎇0⎇2⎇0⎇⎇␈F2INTRODUCTION␈F1␈←
5⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇␈←
6⎇⎇␈F1The⎇following⎇short⎇manual⎇describes⎇the⎇changes⎇that⎇have⎇happened⎇to⎇SAIL⎇since⎇the⎇publishing
7⎇⎇␈F1of⎇the⎇Manual⎇in⎇July⎇1973.⎇It⎇accurately⎇reflects⎇the⎇state⎇of⎇SAIL,⎇version⎇18,⎇which⎇was⎇last
8⎇⎇␈F1modified⎇on⎇March⎇2,⎇1976.⎇ The⎇reader⎇should⎇be⎇warned⎇that⎇many⎇of⎇these⎇new⎇features⎇were
9⎇⎇␈F1designed⎇for⎇veteran⎇SAIL⎇hackers.
10⎇⎇␈F1The⎇reader⎇may⎇also⎇want⎇to⎇refer⎇to⎇the⎇following⎇documents,⎇which⎇are⎇usually⎇kept⎇updated.
11⎇⎇␈F1MACLIE.WRU[DOC,AIL]␈=320⎇A⎇summary⎇of⎇commonly⎇made⎇errors⎇when⎇using⎇macros⎇and⎇what⎇to⎇do
12⎇⎇␈F1␈=320⎇about⎇them.
13⎇⎇␈F1TUTOR.DOC[DOC,AIL]␈=320⎇In⎇introduction⎇to⎇LEAP.
14⎇⎇␈F1LEAP.WRU[DOC,AIL]␈=320⎇A⎇detailed⎇description⎇of⎇the⎇runtime⎇environment⎇of⎇LEAP⎇for⎇the⎇hardy
15⎇⎇␈F1␈=320⎇few⎇who⎇want⎇to⎇interface⎇to⎇LEAP⎇in⎇assembly⎇language.
16⎇⎇␈F1SAIL.DOC[AIM,DOC]␈=320⎇The⎇July⎇'73⎇manual⎇(AIM-204)⎇in⎇LPT⎇form.⎇Warning:⎇this⎇version⎇is⎇the
17⎇⎇␈F1␈=320⎇Stanford⎇character⎇set.⎇ It⎇is⎇also⎇almost⎇300⎇pages⎇long.⎇ You⎇can⎇get⎇a
18⎇⎇␈F1␈=320⎇120⎇page⎇version,⎇set⎇in⎇two⎇columns⎇of⎇nice⎇type⎇from⎇the⎇National
19⎇⎇␈F1␈=320⎇Technical⎇Information⎇Service,⎇Springfield,⎇Virginia⎇22151.
20⎇⎇␈F1LIES[DOC,AIL]␈=320⎇This⎇file⎇contains⎇the⎇know⎇mistakes⎇in⎇the⎇Manual.⎇Soon⎇it⎇will⎇also
21⎇⎇␈F1␈=320⎇contain⎇the⎇known⎇mistakes⎇in⎇this⎇document.
22⎇⎇␈F1␈→1069⎇0⎇2⎇0⎇⎇␈F2SECTION  2␈F1␈←
23⎇⎇␈F1SAIL Addendum  1␈→970⎇243⎇1⎇0⎇⎇NUMERICAL ROUTINES␈←
24⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16411⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
25⎇⎇␈F1␈→834⎇0⎇2⎇0⎇⎇␈F2NUMERICAL ROUTINES␈F1␈←
26⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇␈←
27⎇⎇␈F1A⎇collection⎇of⎇numerical⎇routines⎇has⎇been⎇added⎇to⎇SAIL.⎇ These⎇are⎇pre-declared⎇in⎇the
28⎇⎇␈F1compiler,⎇and⎇are⎇loaded⎇from⎇the⎇standard⎇SAIL⎇library.⎇ The⎇functions⎇are⎇quite⎇standard;
29⎇⎇␈F1following⎇are⎇the⎇equivalent⎇definitions:
30⎇⎇␈F11.␈=64⎇The⎇standard⎇trigonometric⎇functions.⎇ ASIN,⎇ACOS,⎇ATAN⎇and⎇ATAN2⎇return⎇results⎇in
31⎇⎇␈F1␈=64⎇radians.⎇ The⎇ATAN2⎇call⎇takes⎇arc-tangent⎇of⎇the⎇quotient⎇of⎇its⎇arguments;⎇in⎇this⎇way,⎇it
32⎇⎇␈F1␈=64⎇correctly⎇preserves⎇sign⎇information.
33⎇⎇␈F1        REAL PROCEDURE SIN (REAL RADIANS);
34⎇⎇␈F1        REAL PROCEDURE COS (REAL RADIANS);
35⎇⎇␈F1        REAL PROCEDURE SIND (REAL DEGREES);
36⎇⎇␈F1        REAL PROCEDURE COSD (REAL DEGREES);
37⎇⎇␈F1        REAL PROCEDURE ASIN (REAL ARGUMENT);
38⎇⎇␈F1        REAL PROCEDURE ACOS (REAL ARGUMENT);
39⎇⎇␈F1        REAL PROCEDURE ATAN (REAL ARGUMENT);
40⎇⎇␈F1        REAL PROCEDURE ATAN2 (REAL NUMERATOR,DENOMINATOR);
41⎇⎇␈F12.␈=64⎇The⎇hyperbolic⎇trigonometric⎇functions.
42⎇⎇␈F1        REAL PROCEDURE SINH (REAL ARGUMENT);
43⎇⎇␈F1        REAL PROCEDURE COSH (REAL ARGUMENT);
44⎇⎇␈F1        REAL PROCEDURE TANH (REAL ARGUMENT);
45⎇⎇␈F13.⎇␈=64⎇The⎇square-root⎇function:
46⎇⎇␈F1        REAL PROCEDURE SQRT (REAL ARGUMENT);
47⎇⎇␈F14.␈=64⎇A⎇pseudo-random⎇number⎇generator.⎇ The⎇argument⎇specifies⎇a⎇new⎇value⎇for⎇the⎇seed⎇(If⎇the
48⎇⎇␈F1␈=64⎇argument⎇is⎇0,⎇the⎇old⎇seed⎇value⎇is⎇used.⎇ Thus⎇to⎇get⎇differing⎇random⎇numbers,⎇this
49⎇⎇␈F1␈=64⎇argument⎇should⎇be⎇zero.)⎇ Results⎇are⎇normalized⎇to⎇lie⎇in⎇the⎇range⎇[0,1].
50⎇⎇␈F1        REAL PROCEDURE RAN (INTEGER SEED);
51⎇⎇␈F15.␈=64⎇Logarithm⎇and⎇exponentiation⎇functions.⎇ These⎇functions⎇are⎇the⎇same⎇ones⎇used⎇by⎇the
52⎇⎇␈F1SAIL Addendum  1␈→970⎇243⎇1⎇0⎇⎇NUMERICAL ROUTINES␈←
53⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16413⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
54⎇⎇␈F1␈=64⎇SAIL⎇exponentiation⎇operator.⎇ The⎇base⎇is⎇e⎇(2.71828182845904).⎇ The⎇logarithm⎇to⎇the⎇base
55⎇⎇␈F1␈=64⎇10⎇of⎇e⎇is⎇.4342944819.
56⎇⎇␈F1        REAL PROCEDURE LOG (REAL ARGUMENT);
57⎇⎇␈F1        REAL PROCEDURE EXP (REAL ARGUMENT);
58⎇⎇␈F1These⎇functions⎇may⎇occasionally⎇be⎇asked⎇to⎇compute⎇numbers⎇that⎇lie⎇outside⎇the⎇range⎇of⎇legal
59⎇⎇␈F1floating-point⎇numbers⎇on⎇the⎇PDP-10.⎇ In⎇these⎇cases,⎇the⎇routines⎇issue⎇sprightly⎇error⎇messages
60⎇⎇␈F1that⎇are⎇continuable.
61⎇⎇␈F12.1⎇-⎇␈F2OVERFLOW␈F1
62⎇⎇␈F1In⎇order⎇to⎇better⎇perform⎇their⎇tasks,⎇these⎇routines⎇enable⎇the⎇system⎇interrupt⎇facility⎇for
63⎇⎇␈F1floating-point⎇overflow⎇and⎇underflow⎇errors.⎇ If⎇an⎇underflow⎇is⎇detected,⎇the⎇results⎇are⎇set⎇to
64⎇⎇␈F10⎇(a⎇feat⎇not⎇done⎇by⎇the⎇PDP-10⎇hardware,⎇alas).⎇ Be⎇aware⎇that⎇such⎇underflow⎇fixups⎇will⎇be
65⎇⎇␈F1done⎇to⎇every⎇underflow⎇that⎇occurs⎇in⎇your⎇program.⎇ For⎇further⎇implementation⎇details,⎇see
66⎇⎇␈F1the⎇section⎇below.
67⎇⎇␈F1If⎇you⎇would⎇like⎇to⎇be⎇informed⎇of⎇any⎇numerical⎇exceptions,⎇you⎇can⎇call⎇the⎇runtime:
68⎇⎇␈F1        TRIGINI ( LOCATION(simple-procedure-name) );
69⎇⎇␈F1Every⎇floating-point⎇exception⎇that⎇is⎇not⎇expected⎇by⎇the⎇interrupt⎇handler⎇(the⎇numerical
70⎇⎇␈F1routines⎇use⎇a⎇special⎇convention⎇to⎇indicate⎇that⎇arithmetic⎇exception⎇was⎇expected)⎇will⎇cause
71⎇⎇␈F1the⎇specified⎇simple⎇procedure⎇to⎇be⎇called.⎇ This⎇procedure⎇may⎇look⎇around⎇the⎇world⎇as
72⎇⎇␈F1described⎇in⎇the⎇Manual⎇for⎇'export'⎇interrupt⎇handlers,⎇page⎇79.⎇ If⎇no⎇TRIGINI⎇call⎇is⎇done,⎇the
73⎇⎇␈F1interrupt⎇routine⎇will⎇simply⎇dismiss⎇unexpected⎇floating-point⎇interrupts.
74⎇⎇␈F12.2⎇-⎇␈F2ENTRY⎇POINTS␈F1
75⎇⎇␈F1In⎇order⎇to⎇avoid⎇confusion⎇(by⎇the⎇loader)⎇with⎇older⎇trig⎇packages,⎇the⎇entry⎇points⎇of⎇the⎇SAIL
76⎇⎇␈F1arithmetic⎇routines⎇all⎇have⎇a⎇"$"⎇appended⎇to⎇the⎇end.⎇ Thus,⎇SIN⎇has⎇the⎇entry⎇point⎇SIN$,⎇etc.
77⎇⎇␈F1WARNING:⎇If⎇a⎇program⎇plans⎇to⎇use⎇the⎇SAIL⎇intrinsic⎇numerical⎇routines,⎇it⎇should⎇NOT⎇include
78⎇⎇␈F1external⎇declarations⎇to⎇them,⎇since⎇this⎇will⎇probably⎇cause⎇the⎇FORTRAN⎇library⎇routines⎇to⎇be
79⎇⎇␈F1loaded.
80⎇⎇␈F1SAIL Addendum  1␈→970⎇243⎇1⎇0⎇⎇NUMERICAL ROUTINES␈←
81⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16416⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
82⎇⎇␈F12.3⎇-⎇␈F2OVERFLOW⎇IMPLEMENTATION␈F1
83⎇⎇␈F1This⎇section⎇may⎇be⎇skipped⎇by⎇all⎇but⎇those⎇interested⎇in⎇interfacing⎇number⎇crunching⎇assembly
84⎇⎇␈F1code⎇with⎇SAIL⎇routines⎇where⎇overflow⎇and⎇underflow⎇are⎇expected⎇to⎇be⎇a⎇problem.
85⎇⎇␈F1The⎇SAIL⎇arithmetic⎇interrupt⎇routines⎇first⎇check⎇to⎇see⎇if⎇the⎇interrupt⎇was⎇caused⎇by⎇floating
86⎇⎇␈F1exponent⎇underflow.⎇If⎇it⎇was,⎇then⎇the⎇result⎇is⎇set⎇to⎇zero,⎇be⎇it⎇in⎇an⎇accumulator,⎇memory,⎇or
87⎇⎇␈F1both.⎇ Then⎇if⎇the⎇arithmetic⎇instruction⎇that⎇causes⎇the⎇interrupt⎇if⎇followed⎇by⎇a⎇JFCL,⎇the⎇AC
88⎇⎇␈F1field⎇of⎇the⎇JFCL⎇is⎇compared⎇with⎇the⎇PC⎇flag⎇bits⎇to⎇see⎇if⎇the⎇JFCL⎇tests⎇for⎇any⎇of⎇the⎇flags
89⎇⎇␈F1that⎇are⎇on.⎇If⎇it⎇does,⎇those⎇flags⎇are⎇cleared⎇and⎇the⎇program⎇proceeds⎇at⎇the⎇effective⎇address
90⎇⎇␈F1of⎇the⎇JFCL⎇(i.e.,⎇the⎇hardware⎇is⎇simulated⎇in⎇that⎇case).⎇Note⎇that⎇no⎇instructions⎇may⎇intervene
91⎇⎇␈F1between⎇the⎇interrupt-causing⎇instruction⎇and⎇the⎇JFCL⎇or⎇the⎇interrupt⎇routines⎇will⎇not⎇see⎇the
92⎇⎇␈F1JFCL.⎇They⎇only⎇look⎇one⎇instruction⎇ahead.⎇ Note⎇that⎇in⎇any⎇case,⎇floating⎇exponent⎇underflow
93⎇⎇␈F1always⎇causes⎇the⎇result⎇to⎇be⎇set⎇to⎇zero.⎇There⎇is⎇no⎇way⎇to⎇disable⎇that⎇effect.
94⎇⎇␈F1␈→1069⎇0⎇2⎇0⎇⎇␈F2SECTION  3␈F1␈←
95⎇⎇␈F1SAIL Addendum  1␈→934⎇243⎇1⎇0⎇⎇NEW PROCESS FEATURES␈←
96⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16418⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
97⎇⎇␈F1␈→785⎇0⎇2⎇0⎇⎇␈F2NEW PROCESS FEATURES␈F1␈←
98⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇␈←
99⎇⎇␈F13.1⎇-⎇␈F2SPROUT⎇APPLY␈F1
100⎇⎇␈F1The⎇<procedure⎇call>⎇in⎇a⎇SPROUT⎇statement⎇may⎇be⎇an⎇APPLY⎇construct.⎇ In⎇ this⎇case⎇SPROUT
101⎇⎇␈F1will⎇ do⎇the⎇"right"⎇thing⎇ about⎇setting⎇up⎇the⎇static⎇link⎇for⎇ the⎇APPLY.⎇That⎇is,⎇"up-level"
102⎇⎇␈F1references⎇by⎇the⎇process⎇will⎇be⎇made⎇to⎇the⎇same⎇variable⎇instances⎇that⎇would⎇be⎇used⎇if⎇the
103⎇⎇␈F1APPLY⎇did⎇not⎇occur⎇in⎇a⎇SPROUT⎇statement.⎇(See⎇page⎇77⎇of⎇the⎇manual.)
104⎇⎇␈F1However,⎇there⎇is⎇a⎇glitch.⎇The⎇sprout⎇mechanism⎇is⎇not⎇yet⎇smart⎇enough⎇to⎇find⎇out⎇the⎇block
105⎇⎇␈F1of⎇the⎇declaration⎇of⎇the⎇procedure⎇used⎇to⎇define⎇the⎇procedure⎇item.⎇It⎇would⎇be⎇nice⎇if⎇it⎇did,
106⎇⎇␈F1since⎇then⎇it⎇could⎇warn⎇the⎇user⎇when⎇that⎇block⎇was⎇exited⎇and⎇yet⎇the⎇process⎇was⎇still⎇alive,
107⎇⎇␈F1and⎇thus⎇potentially⎇able⎇to⎇refer⎇to⎇deallocated⎇arrays⎇and⎇etc.⎇What⎇the⎇sprout⎇does⎇instead⎇is
108⎇⎇␈F1assume⎇the⎇procedure⎇was⎇declared⎇in⎇the⎇outer⎇block.⎇This⎇may⎇be⎇fixed⎇ eventually,⎇but⎇in⎇the
109⎇⎇␈F1meantime⎇ some⎇extra⎇care⎇should⎇be⎇taken⎇ when⎇using⎇ apply⎇in⎇sprouts⎇to⎇ avoid⎇ exiting⎇a
110⎇⎇␈F1block⎇ with⎇dependents.⎇   Similarly,⎇be⎇warned⎇ that⎇the⎇"DEPENDENTS⎇(<blockid>)"⎇construct
111⎇⎇␈F1may⎇ not⎇give⎇ the⎇ "right"⎇result⎇ for⎇ sprout⎇applies.⎇Page⎇68⎇of⎇the⎇Manual⎇contains⎇the
112⎇⎇␈F1description⎇of⎇this⎇protection⎇mechanism⎇for⎇non-APPLY⎇Sprouts.
113⎇⎇␈F13.2⎇-⎇␈F2SPROUT_DEFAULTS␈F1
114⎇⎇␈F1SAIL⎇ now⎇provides⎇ a⎇mechanism⎇ by⎇which⎇ the⎇user⎇ may⎇specify⎇ the⎇"default"⎇options⎇to⎇be
115⎇⎇␈F1used⎇when⎇individual⎇procedures⎇are⎇sprouted.
116⎇⎇␈F3Syntax:
117⎇⎇␈F3        PROCEDURE <procid> ...
118⎇⎇␈F3         BEGIN
119⎇⎇␈F3         <some declarations>;
120⎇⎇␈F3         SPROUT_DEFAULTS <integer constant>;
121⎇⎇␈F3         <perhaps some more declarations>;
122⎇⎇␈F3         :
123⎇⎇␈F3         :
124⎇⎇␈F3         <statements>
125⎇⎇␈F1SAIL Addendum  1␈→934⎇243⎇1⎇0⎇⎇NEW PROCESS FEATURES␈←
126⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16422⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
127⎇⎇␈F3         :
128⎇⎇␈F3         END;
129⎇⎇␈F1In⎇other⎇words,⎇SPROUT_DEFAULTS⎇is⎇a⎇declaration.
130⎇⎇␈F1Semantics:
131⎇⎇␈F1If⎇ one⎇of⎇the⎇"allocation"⎇fields⎇of⎇ the⎇options⎇word⎇passed⎇to⎇the⎇SPROUT⎇routine⎇--⎇i.e.
132⎇⎇␈F1QUANTUM,STRINGSTACK,PSTACK,⎇or⎇ PRIORITY⎇--⎇is⎇zero,⎇  then⎇ SPROUT⎇ will⎇look⎇ at
133⎇⎇␈F1the⎇corresponding⎇ field⎇of⎇ the⎇specified⎇<integer⎇constant>⎇for⎇the⎇procedure⎇being⎇sprouted.⎇If
134⎇⎇␈F1the⎇field⎇is⎇ non-zero,⎇  then⎇ that⎇value⎇ will⎇be⎇ used;⎇otherwise⎇ the⎇current⎇"system"⎇default
135⎇⎇␈F1will⎇be⎇used.
136⎇⎇␈F1NOTE:⎇ SPROUT_DEFAULTS⎇ only⎇applies⎇ to⎇ "allocations",⎇i.e.⎇  the⎇process⎇status⎇control⎇bits
137⎇⎇␈F1(e.g.⎇SUSPME)⎇are⎇not⎇affected.
138⎇⎇␈F3Example:
139⎇⎇␈F3        RECURSIVE PROCEDURE FOO;
140⎇⎇␈F3         BEGIN
141⎇⎇␈F3         SPROUT_DEFAULTS STRINGSTACK(10);
142⎇⎇␈F3         INTEGER XXX;
143⎇⎇␈F3         :
144⎇⎇␈F3         :
145⎇⎇␈F3         END;
146⎇⎇␈F3        :
147⎇⎇␈F3        SPROUT(P1,FOO,STRINGSTACK(3));
148⎇⎇␈F3        SPROUT(P2,FOO);
149⎇⎇␈F3        COMMENT P1 will have a string stack of 3*32 words.
150⎇⎇␈F3         P2 will have a string stack of 10*32 words;
151⎇⎇␈F1SAIL Addendum  1␈→934⎇243⎇1⎇0⎇⎇NEW PROCESS FEATURES␈←
152⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16423⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
153⎇⎇␈F13.3⎇-⎇␈F2SUSPEND␈F1
154⎇⎇␈F1SUSPEND⎇now⎇behaves⎇like⎇RESUME⎇in⎇that⎇it⎇returns⎇an⎇item.
155⎇⎇␈F1        itm ← SUSPEND(<process item>)
156⎇⎇␈F1Frequently,⎇one⎇is⎇suspending⎇some⎇other⎇process⎇than⎇the⎇one⎇that⎇is⎇executing⎇the⎇SUSPEND
157⎇⎇␈F1statement.⎇In⎇this⎇case,⎇the⎇item⎇returned⎇is⎇ANY.⎇  However,⎇in⎇cases⎇like:
158⎇⎇␈F1        X ← SUSPEND(MYPROC);
159⎇⎇␈F1where⎇the⎇process⎇suspends⎇itself,⎇it⎇might⎇happen⎇that⎇this⎇process⎇is⎇made⎇running⎇by⎇a
160⎇⎇␈F1RESUME⎇from⎇another⎇process.⎇If⎇so,⎇then⎇X⎇receives⎇the⎇<return_item>⎇ that⎇was⎇an⎇argument
161⎇⎇␈F1to⎇the⎇RESUME.
162⎇⎇␈F13.4⎇-⎇␈F2FAIL⎇AND⎇SUCCEED␈F1
163⎇⎇␈F1FAIL⎇and⎇SUCCEED⎇now⎇behave⎇like⎇RESUME⎇and⎇SUSPEND⎇in⎇that⎇they⎇also⎇return⎇an⎇item.
164⎇⎇␈F1The⎇item⎇returned⎇is⎇ANY⎇unless⎇the⎇Matching⎇Procedure⎇containing⎇the⎇FAIL⎇or⎇SUCCEED⎇was
165⎇⎇␈F1(1)⎇sprouted⎇as⎇a⎇process,⎇and⎇(2)⎇made⎇running⎇by⎇a⎇RESUME⎇construct.⎇ In⎇the⎇latter⎇case,⎇the
166⎇⎇␈F1item⎇returned⎇is⎇the⎇<return_item>⎇that⎇was⎇an⎇argument⎇to⎇the⎇RESUME.⎇ [Note⎇that⎇the⎇only
167⎇⎇␈F1case⎇in⎇which⎇a⎇Matching⎇Procedure⎇can⎇be⎇reactivated⎇at⎇a⎇FAIL⎇is⎇by⎇being⎇RESUMEd.]
168⎇⎇␈F1␈→1069⎇0⎇2⎇0⎇⎇␈F2SECTION  4␈F1␈←
169⎇⎇␈F1SAIL Addendum  1␈→1040⎇243⎇1⎇0⎇⎇ERROR HANDLING␈←
170⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16426⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
171⎇⎇␈F1␈→929⎇0⎇2⎇0⎇⎇␈F2ERROR HANDLING␈F1␈←
172⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇␈←
173⎇⎇␈F14.1⎇-⎇␈F2ERROR⎇MODES␈F1
174⎇⎇␈F1SAIL's⎇error⎇ handler⎇has⎇at⎇ long⎇last⎇been⎇ modified⎇to⎇do⎇ what⎇is⎇claimed⎇it⎇will⎇do⎇ in⎇Section
175⎇⎇␈F120⎇of⎇the⎇manual⎇(pgs⎇95⎇-⎇97),⎇and⎇in⎇the⎇description⎇of⎇USERERR⎇(pg⎇42).⎇ In⎇brief,⎇it⎇allows⎇one
176⎇⎇␈F1to⎇ have⎇error⎇ messages⎇automatically⎇ sent⎇ to⎇ a⎇"log"⎇ file⎇ while⎇one⎇ is⎇compiling,⎇and⎇to⎇use
177⎇⎇␈F1USERERR⎇as⎇a⎇trace⎇statement.
178⎇⎇␈F1The⎇description⎇given⎇in⎇the⎇manual⎇differs⎇from⎇reality⎇in⎇two⎇ways:⎇"Keep"⎇mode⎇has⎇not⎇ been
179⎇⎇␈F1implemented⎇(the⎇error⎇handler⎇ will⎇flush⎇all⎇type-ahead⎇except⎇a⎇<lf>);⎇  all⎇of⎇the⎇ other⎇modes
180⎇⎇␈F1("Quiet",⎇ "Logging",⎇and⎇"Numbers")⎇are⎇implemented⎇ONLY⎇ IN⎇THE⎇COMPILER.⎇  However,⎇one
181⎇⎇␈F1can⎇get⎇the⎇effect⎇of⎇error⎇modes⎇at⎇runtime⎇by⎇using⎇a⎇brand⎇new⎇feature⎇called⎇user⎇error
182⎇⎇␈F1procedures.
183⎇⎇␈F14.2⎇-⎇␈F2ALTMODE⎇RESPONSE␈F1
184⎇⎇␈F1After⎇an⎇"E"⎇or⎇"T"⎇response⎇to⎇the⎇error⎇handler,⎇an⎇altmode⎇will⎇return⎇to⎇the⎇question⎇loop;
185⎇⎇␈F1i.e.,⎇you⎇may⎇change⎇your⎇mind⎇if⎇you⎇do⎇not⎇wish⎇to⎇edit.⎇ Normal⎇monitor⎇line⎇editing⎇of⎇the⎇file
186⎇⎇␈F1name⎇is⎇allowed.
187⎇⎇␈F14.3⎇-⎇␈F2USER⎇ERROR⎇PROCEDURES␈F1
188⎇⎇␈F1A⎇ user⎇error⎇ procedure⎇is⎇a⎇ user⎇procedure⎇ that⎇is⎇run⎇ before⎇or⎇instead⎇of⎇ the⎇ SAIL⎇error
189⎇⎇␈F1handler⎇ everytime⎇ an⎇error⎇ occurs⎇ at⎇runtime.⎇ This⎇ includes⎇all⎇array⎇errors,⎇IO⎇ errors,
190⎇⎇␈F1Leapish⎇errors⎇and⎇all⎇USERERRs.⎇ It⎇does⎇not⎇include⎇system⎇errors,⎇such⎇as⎇Ill⎇Mem⎇Ref⎇or⎇Ill
191⎇⎇␈F1UUO.
192⎇⎇␈F1The⎇ procedure⎇one⎇uses⎇ for⎇a⎇ user⎇error⎇procedure⎇ must⎇be⎇ of⎇the⎇following⎇type:
193⎇⎇␈F1SAIL Addendum  1␈→1040⎇243⎇1⎇0⎇⎇ERROR HANDLING␈←
194⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16431⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
195⎇⎇␈F1␈→359⎇0⎇2⎇0⎇⎇SIMPLE INTEGER PROCEDURE proc (INTEGER loc; STRING msg, rsp);␈←
196⎇⎇␈F1Only⎇the⎇names⎇ proc,⎇loc,⎇ msg,⎇and⎇rsp⎇ may⎇vary⎇ from⎇the⎇ example⎇above,⎇except⎇ that⎇one
197⎇⎇␈F1may⎇declare⎇ the⎇procedure⎇ INTERNAL⎇if⎇ one⎇wishes⎇to⎇use⎇it⎇across⎇files.
198⎇⎇␈F1Whenever⎇ the⎇external⎇integer⎇_ERRP_⎇ is⎇loaded⎇with⎇LOCATION(proc),⎇the⎇error⎇handler⎇will
199⎇⎇␈F1call⎇proc⎇before⎇it⎇ does⎇anything⎇else.⎇  It⎇will⎇set⎇loc⎇to⎇ the⎇core⎇location⎇of⎇the⎇call⎇ to⎇the
200⎇⎇␈F1error⎇handler.⎇ Msg⎇ will⎇be⎇ the⎇message⎇ that⎇it⎇ would⎇have⎇ printed.⎇ Rsp⎇will⎇be⎇non-NULL
201⎇⎇␈F1only⎇if⎇the⎇error⎇was⎇from⎇a⎇USERERR⎇which⎇had⎇response⎇string⎇argument.⎇ Proc⎇can⎇do⎇anything
202⎇⎇␈F1that⎇ a⎇simple⎇procedure⎇can⎇do.⎇ When⎇it⎇exits,⎇it⎇should⎇ return⎇an⎇ integer⎇which⎇ tells⎇the
203⎇⎇␈F1error⎇handler⎇ if⎇ it⎇should⎇do⎇anything⎇more.⎇ If⎇the⎇integer⎇is⎇0,⎇the⎇error⎇handler⎇will⎇(1)⎇ print
204⎇⎇␈F1the⎇ message,⎇(2)⎇ print⎇the⎇location,⎇and⎇(3)⎇query⎇the⎇tty⎇and⎇dispatch⎇on⎇the⎇response⎇character
205⎇⎇␈F1(i.e⎇ask⎇for⎇a⎇<cr>,⎇<lf>,⎇etc.).⎇ If⎇the⎇right⎇half⎇of⎇the⎇integer⎇is⎇non-zero,⎇it⎇is⎇taken⎇as⎇the⎇ascii
206⎇⎇␈F1for⎇a⎇character⎇to⎇dispatch⎇upon.⎇ The⎇left⎇half⎇may⎇have⎇two⎇bits⎇to⎇control⎇printing.⎇  If⎇bit⎇17
207⎇⎇␈F1in⎇the⎇integer⎇is⎇on,⎇message⎇printing⎇is⎇inhibited.⎇ If⎇bit⎇16⎇is⎇on,⎇then⎇the⎇location⎇printing⎇is
208⎇⎇␈F1inhibited.⎇For⎇example,⎇"X"+(1⎇LSH⎇18)⎇will⎇cause⎇the⎇location⎇to⎇be⎇printed⎇and⎇the⎇program
209⎇⎇␈F1exited.⎇"C"+(3⎇LSH⎇18)⎇will⎇cause⎇the⎇error⎇handler⎇to⎇continue⎇without⎇printing⎇anything.
210⎇⎇␈F1Note⎇that⎇simple⎇ procedures⎇can⎇not⎇do⎇ a⎇non-local⎇GOTO.⎇  However,⎇the⎇ effect⎇of⎇ a⎇non-
211⎇⎇␈F1local⎇ GOTO⎇ can⎇be⎇ achieved⎇in⎇ a⎇ user⎇error⎇procedure⎇by⎇loading⎇the⎇external⎇integer
212⎇⎇␈F1_ERRJ_⎇with⎇the⎇LOCATION⎇of⎇a⎇label.⎇The⎇label⎇should⎇be⎇a⎇on⎇a⎇call⎇to⎇a⎇non-simple⎇procedure
213⎇⎇␈F1which⎇does⎇the⎇desired⎇GOTO.⎇ The⎇error⎇handler⎇clears⎇_ERRJ_⎇before⎇calling⎇the⎇procedure⎇in
214⎇⎇␈F1_ERRP_.⎇ If⎇_ERRJ_⎇ is⎇non-zero⎇when⎇the⎇ user⎇procedure⎇returns,⎇and⎇continuing⎇was⎇specified,
215⎇⎇␈F1then⎇the⎇error⎇handler's⎇exit⎇ consists⎇of⎇a⎇simple⎇transfer⎇to⎇ that⎇location.⎇ Note⎇that⎇for⎇this
216⎇⎇␈F1simple⎇transfer⎇to⎇work⎇properly,⎇the⎇place⎇where⎇the⎇error⎇occurred⎇(or⎇the⎇call⎇to⎇USERERR)
217⎇⎇␈F1must⎇be⎇in⎇the⎇same⎇static⎇(lexical)⎇scope⎇as⎇the⎇label⎇whose⎇LOCATION⎇is⎇in⎇_ERRJ_.⎇ If⎇this⎇is
218⎇⎇␈F1really⎇important⎇to⎇you,⎇see⎇a⎇SAIL⎇hacker.
219⎇⎇␈F1WARNING!⎇Handling⎇errors⎇from⎇strange⎇places⎇like⎇the⎇string⎇garbage⎇collector⎇and⎇the⎇core
220⎇⎇␈F1management⎇routines⎇will⎇get⎇you⎇into⎇deep⎇trouble.
221⎇⎇␈F1␈→1069⎇0⎇2⎇0⎇⎇␈F2SECTION  5␈F1␈←
222⎇⎇␈F1SAIL Addendum  1␈→856⎇243⎇1⎇0⎇⎇INEXHAUSTIBLE STRING SPACE␈←
223⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16432⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
224⎇⎇␈F1␈→657⎇0⎇2⎇0⎇⎇␈F2INEXHAUSTIBLE STRING SPACE␈F1␈←
225⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇␈←
226⎇⎇␈F1The⎇string⎇garbage⎇collector⎇has⎇been⎇modified⎇to⎇expand⎇string⎇space⎇(using⎇discontiguous⎇blocks)
227⎇⎇␈F1whenever⎇necessary⎇to⎇satisfy⎇the⎇demand⎇for⎇places⎇to⎇put⎇strings.⎇To⎇take⎇advantage⎇ of⎇ this
228⎇⎇␈F1feature,⎇ one⎇need⎇not⎇change⎇his⎇programs.
229⎇⎇␈F1Here⎇are⎇some⎇points⎇which⎇might⎇be⎇of⎇interest,⎇however:
230⎇⎇␈F11)␈=64⎇Although⎇ we⎇ are⎇ going⎇ to⎇ provide⎇ user⎇control⎇over⎇all⎇size⎇parameters⎇eventually,
231⎇⎇␈F1␈=64⎇currently⎇only⎇ the⎇ initial⎇ string⎇ space⎇size⎇ is⎇ settable⎇ by⎇ the⎇ user,⎇either⎇via
232⎇⎇␈F1␈=64⎇REQUIRE⎇or⎇the⎇ALLOC⎇sequence,⎇as⎇before.⎇ The⎇size⎇of⎇each⎇string⎇space⎇increment⎇will
233⎇⎇␈F1␈=64⎇be⎇ the⎇same⎇as⎇the⎇original⎇size,⎇which⎇need⎇not⎇be⎇monstrous⎇any⎇more⎇unless⎇you⎇ know
234⎇⎇␈F1␈=64⎇that⎇all⎇runs⎇of⎇your⎇program⎇will⎇ need⎇ a⎇monstrous⎇ string⎇ space⎇ anyhow.⎇  The
235⎇⎇␈F1␈=64⎇threshold⎇(see⎇below)⎇for⎇expanding⎇will⎇be⎇set⎇at⎇1/8⎇ the⎇ string⎇ space⎇ size⎇ (increment
236⎇⎇␈F1␈=64⎇size).
237⎇⎇␈F12)␈=64⎇One⎇can,⎇in⎇his⎇program,⎇modify⎇these⎇values⎇independently,⎇if⎇he⎇is⎇willing⎇to⎇use⎇the
238⎇⎇␈F1␈=64⎇USERCON⎇function,⎇and⎇to⎇follow⎇this⎇format:
239⎇⎇␈F4     USER TABLE ENTRY NAME              VALUE
240⎇⎇␈F4        STINCR          lh: number of chars. in increment
241⎇⎇␈F4                        rh: number of words in increment + 4
242⎇⎇␈F4        STREQD          lh: number of chars. in threshold
243⎇⎇␈F4                        rh: number of words in threshold.
244⎇⎇␈F13)␈=64⎇The⎇threshold.⎇ Afp
r⎇garbage⎇collection,⎇let⎇us⎇say⎇that⎇M-1⎇discontiguous⎇string⎇spaces⎇ are
245⎇⎇␈F1␈=64⎇full,⎇ and⎇ the⎇ M'th⎇ has⎇ n⎇ free⎇ characters⎇in⎇it⎇(available⎇for⎇new⎇strings).⎇ The⎇ garbage
246⎇⎇␈F1␈=64⎇collector⎇ was⎇ called⎇because⎇ some⎇routine⎇wanted⎇to⎇create⎇a⎇string⎇R⎇characters⎇long,⎇and
247⎇⎇␈F1␈=64⎇there⎇were⎇not⎇that⎇many⎇ available⎇(free).⎇    After⎇ garbage⎇collection,⎇ the⎇new⎇algorithm
248⎇⎇␈F1␈=64⎇requires⎇that⎇N⎇be⎇greater⎇than⎇R+LH(STREQD).⎇ If⎇it⎇is⎇not,⎇expansion⎇takes⎇place⎇(to⎇M+1
249⎇⎇␈F1␈=64⎇spaces),⎇to⎇ satisfy⎇ this⎇requirement.⎇   In⎇other⎇words,⎇if⎇STREQD⎇is⎇1/8⎇the⎇size⎇of⎇the
250⎇⎇␈F1␈=64⎇current⎇space,⎇that⎇space⎇will⎇not⎇be⎇ allowed⎇ to⎇become⎇ more⎇ than⎇ about⎇ 7/8⎇ full.
251⎇⎇␈F1␈=64⎇This⎇helps⎇avoid⎇frequent,⎇nearly⎇useless⎇calls⎇on⎇the⎇garbage⎇collector⎇when⎇ space⎇is⎇about
252⎇⎇␈F1␈=64⎇gone.⎇  All⎇but⎇the⎇current⎇space⎇are⎇allowed⎇to⎇become⎇as⎇full⎇as⎇possible,⎇however.
253⎇⎇␈F14)␈=64⎇New⎇statistics⎇are⎇maintained⎇by⎇the⎇ garbage⎇ collector.⎇    Soon⎇there⎇ will⎇ be⎇a⎇built-in
254⎇⎇␈F1SAIL Addendum  1␈→856⎇243⎇1⎇0⎇⎇INEXHAUSTIBLE STRING SPACE␈←
255⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16434⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
256⎇⎇␈F1␈=64⎇routine⎇you⎇can⎇use⎇to⎇print⎇them.⎇ For⎇now,⎇you⎇may⎇look⎇at⎇them⎇using⎇USERCON,
257⎇⎇␈F1␈=64⎇although⎇this⎇ document⎇ does⎇not⎇ say⎇ what⎇ they⎇ are.⎇    In⎇ order⎇to⎇activate⎇timing⎇of
258⎇⎇␈F1␈=64⎇the⎇garbage⎇collector⎇(slows⎇it⎇down),⎇set⎇SGCTIME⎇in⎇the⎇ user⎇ table⎇to⎇-1.
259⎇⎇␈F15)␈=64⎇Future⎇plans.⎇ The⎇ new⎇ structure⎇ not⎇only⎇allows⎇expansion⎇of⎇string⎇space,⎇it⎇also⎇will
260⎇⎇␈F1␈=64⎇allow⎇ for⎇ partial⎇ garbage⎇ collections⎇ (no⎇ visible⎇benefits⎇ except⎇ increased⎇speed,⎇since
261⎇⎇␈F1␈=64⎇a⎇partial⎇collection⎇will⎇be⎇almost⎇as⎇effective⎇as⎇a⎇complete⎇one,⎇and⎇ much⎇ faster),⎇ and⎇the
262⎇⎇␈F1␈=64⎇ability⎇ to⎇ move⎇ string⎇ space⎇ blocks,⎇in⎇order⎇to⎇compact⎇memory.⎇ Push⎇on⎇your⎇local
263⎇⎇␈F1␈=64⎇representative⎇ to⎇ get⎇ these⎇ things⎇done.
264⎇⎇␈F1␈→1069⎇0⎇2⎇0⎇⎇␈F2SECTION  6␈F1␈←
265⎇⎇␈F1SAIL Addendum  1␈→979⎇243⎇1⎇0⎇⎇RECORD STRUCTURES␈←
266⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16435⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
267⎇⎇␈F1␈→851⎇0⎇2⎇0⎇⎇␈F2RECORD STRUCTURES␈F1␈←
268⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇␈←
269⎇⎇␈F16.1⎇-⎇␈F2INTRODUCTORY⎇REMARKS␈F1
270⎇⎇␈F1Record⎇structures⎇are⎇a⎇fairly⎇recent⎇addition⎇to⎇SAIL.⎇ Essentially,⎇they⎇provide⎇ a⎇means⎇by
271⎇⎇␈F1which⎇a⎇ number⎇of⎇closely⎇related⎇variables⎇may⎇be⎇allocated⎇and⎇manipulated⎇ as⎇a⎇unit,⎇without
272⎇⎇␈F1the⎇overhead⎇ or⎇limitations⎇associated⎇ with⎇using⎇parallel⎇ arrays⎇and⎇without⎇the⎇restriction
273⎇⎇␈F1that⎇the⎇variables⎇all⎇be⎇of⎇the⎇same⎇data⎇type.⎇ In⎇ the⎇current⎇implementation,⎇each⎇ record⎇is⎇an
274⎇⎇␈F1instance⎇of⎇a⎇user-defined⎇"record⎇class",⎇which⎇serves⎇as⎇ a⎇template⎇describing⎇the⎇ various
275⎇⎇␈F1subfields⎇of⎇the⎇record.⎇ Internally,⎇records⎇are⎇small⎇blocks⎇of⎇storage⎇which⎇contain⎇space⎇for
276⎇⎇␈F1the⎇various⎇ subfields⎇and⎇ a⎇pointer⎇ to⎇a⎇ class⎇descriptor⎇record.⎇  Subfields⎇ are⎇allocated⎇ one
277⎇⎇␈F1per⎇ word⎇and⎇ are⎇accessed⎇by⎇ constant⎇indexing⎇off⎇the⎇ record⎇pointer.⎇ Deallocation⎇is
278⎇⎇␈F1performed⎇automatically⎇by⎇a⎇garbage⎇collector⎇or⎇manually⎇through⎇explicit⎇calls⎇to⎇a⎇deallocation
279⎇⎇␈F1procedure.
280⎇⎇␈F1Records⎇were⎇originally⎇added⎇ to⎇SAIL⎇to⎇ fullfill⎇a⎇number⎇of⎇ very⎇specific⎇needs⎇at⎇Stanford,
281⎇⎇␈F1and⎇ were⎇subsequently⎇generalized⎇to⎇the⎇form⎇ seen⎇ here.⎇   The⎇structures⎇ described⎇ in⎇ this
282⎇⎇␈F1section⎇are⎇implemented⎇and,⎇so⎇far⎇as⎇is⎇known,⎇work⎇correctly.⎇ (They⎇have⎇been⎇used
283⎇⎇␈F1successfully⎇by⎇several⎇different⎇people⎇to⎇produce⎇a⎇number⎇of⎇sizable⎇programs).⎇ Readers⎇are
284⎇⎇␈F1strongly⎇urged⎇to⎇look⎇at⎇the⎇ file⎇RECAUX.SAI[CSP,SYS],⎇which⎇contains⎇a⎇ number⎇of⎇useful
285⎇⎇␈F1examples⎇and⎇auxilliary⎇functions.
286⎇⎇␈F16.2⎇-⎇␈F2RECORD⎇CLASS⎇DECLARATIONS␈F1
287⎇⎇␈F1        RECORD_CLASS <classid> (<subfield declarations>)
288⎇⎇␈F1For instance,
289⎇⎇␈F1        RECORD_CLASS VECTOR (REAL X,Y,Z);
290⎇⎇␈F1        RECORD_CLASS CELL (RECORD_POINTER(ANY_CLASS) CAR,CDR);
291⎇⎇␈F1        RECORD_CLASS TABLEAU (REAL ARRAY A,B,C;INTEGER N,M);
292⎇⎇␈F1        RECORD_CLASS FOO(LIST L;ITEMVAR A);
293⎇⎇␈F1SAIL Addendum  1␈→979⎇243⎇1⎇0⎇⎇RECORD STRUCTURES␈←
294⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16439⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
295⎇⎇␈F1Generally,⎇ the⎇<subfield⎇ declarations>⎇ have⎇ the⎇ same⎇form⎇ as⎇ a⎇procedure's⎇ formal⎇paramter
296⎇⎇␈F1list,⎇except⎇that⎇ the⎇words⎇ VALUE⎇and⎇REFERENCE⎇should⎇ not⎇ be⎇used.⎇   Each⎇record⎇ class
297⎇⎇␈F1declaration⎇is⎇compiled⎇into⎇ a⎇"record⎇ descriptor"⎇which⎇is⎇ a⎇record⎇ of⎇constant⎇record⎇class
298⎇⎇␈F1$CLASS⎇and⎇is⎇used⎇by⎇the⎇runtime⎇system⎇for⎇allocation,⎇deallocation,⎇garbage⎇collection,⎇etc.
299⎇⎇␈F16.3⎇-⎇␈F2RECORD⎇POINTER⎇DECLARATIONS␈F1
300⎇⎇␈F1        RECORD_POINTER(<classid list>) <id list>
301⎇⎇␈F1        RECORD_POINTER(ANY_CLASS) <id list>
302⎇⎇␈F1For instance,
303⎇⎇␈F1        RECORD_POINTER(VECTOR) V1,V2;
304⎇⎇␈F1        RECORD_POINTER(VECTOR,TABLEAU) T1,T2;
305⎇⎇␈F1        RECORD_POINTER(ANY_CLASS) R;
306⎇⎇␈F1At⎇runtime,⎇these⎇variables⎇contain⎇either⎇the⎇value⎇NULL_RECORD⎇(internally,⎇zero)⎇or⎇else⎇a
307⎇⎇␈F1pointer⎇to⎇a⎇record.⎇ The⎇<classid⎇list>⎇is⎇used⎇to⎇make⎇a⎇compile-time⎇check⎇on⎇assignments⎇and
308⎇⎇␈F1subfield⎇references.⎇ The⎇pseudo-class⎇ANY_CLASS⎇matches⎇all⎇classes,⎇and⎇effectively⎇disables
309⎇⎇␈F1this⎇compile-time⎇check.⎇ For⎇instance:
310⎇⎇␈F1        RECORD_POINTER(FOO,BAR) FB1,FB2;
311⎇⎇␈F1        RECORD_POINTER(FOO) FB3;
312⎇⎇␈F1        RECORD_POINTER(CELL) C;
313⎇⎇␈F1        RECORD_POINTER(ANY_CLASS) RP;
314⎇⎇␈F1        :
315⎇⎇␈F1        COMMENT the following are all ok syntactically;
316⎇⎇␈F1        C←NEW_RECORD(CELL);
317⎇⎇␈F1        RP←C;
318⎇⎇␈F1        FB2←NEW_RECORD(FOO);
319⎇⎇␈F1        FB1←FB3;
320⎇⎇␈F1        FB3←RP; COMMENT Note that this is most likely a runtime bug
321⎇⎇␈F1                        Since RP will contain a cell record.  SAIL
322⎇⎇␈F1                        won't catch it, however;
323⎇⎇␈F1        CELL:CAR[RP]←FB1;
324⎇⎇␈F1        CELL:CAR[RP]←FB1;
325⎇⎇␈F1        COMMENT The compiler will complain about these: ;
326⎇⎇␈F1        FB1←C;
327⎇⎇␈F1        FB3←NEW_RECORD(CELL);
328⎇⎇␈F1        RP←CELL:CAR[FB3];
329⎇⎇␈F1SAIL Addendum  1␈→979⎇243⎇1⎇0⎇⎇RECORD STRUCTURES␈←
330⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16441⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
331⎇⎇␈F1NO⎇runtime⎇class⎇information⎇is⎇kept⎇with⎇the⎇variable,⎇and⎇no⎇runtime⎇class⎇checks⎇are⎇made⎇on
332⎇⎇␈F1record⎇assignment⎇or⎇subfield⎇access.⎇ Record⎇pointer⎇variables⎇are⎇allocated⎇quantities,⎇and⎇should
333⎇⎇␈F1not⎇appear⎇inside⎇SIMPLE⎇procedures.⎇  They⎇resemble⎇lists⎇in⎇that⎇they⎇are⎇not⎇given⎇any⎇special
334⎇⎇␈F1value⎇upon⎇block⎇entry⎇and⎇they⎇are⎇set⎇to⎇a⎇null⎇value⎇(NULL_RECORD)⎇when⎇the⎇block⎇in
335⎇⎇␈F1which⎇they⎇are⎇declared⎇is⎇exited.⎇ (This⎇is⎇so⎇that⎇any⎇records⎇referred⎇to⎇only⎇in⎇that⎇block⎇can
336⎇⎇␈F1be⎇reclaimed⎇by⎇the⎇garbage⎇collector.)
337⎇⎇␈F1Record⎇pointers⎇are⎇regular⎇SAIL⎇data⎇types,⎇just⎇like⎇integers⎇or⎇strings;⎇record⎇pointer
338⎇⎇␈F1procedures,⎇arrays,⎇and⎇items⎇all⎇work⎇in⎇the⎇"normal"⎇way.⎇ As⎇was⎇indicated⎇earlier,⎇the
339⎇⎇␈F1constant⎇NULL_RECORD⎇produces⎇a⎇null⎇reference.
340⎇⎇␈F16.4⎇-⎇␈F2ALLOCATION␈F1
341⎇⎇␈F1Records⎇are⎇allocated⎇by⎇means⎇of⎇the⎇construct
342⎇⎇␈F1        NEW_RECORD(<classid>)
343⎇⎇␈F1which⎇returns⎇a⎇new⎇record⎇of⎇the⎇specified⎇class.⎇ All⎇subfields⎇of⎇the⎇new⎇record⎇are⎇set⎇to⎇the
344⎇⎇␈F1"null"⎇or⎇"zero"⎇value⎇for⎇that⎇subfield⎇--⎇i.e.,⎇real⎇&⎇integer⎇subfields⎇will⎇be⎇set⎇to⎇0,⎇itemvar
345⎇⎇␈F1subfields⎇will⎇be⎇set⎇to⎇ANY,⎇lists⎇will⎇be⎇set⎇to⎇PHI,⎇etc.⎇ Again,⎇note⎇that⎇entry⎇into⎇a⎇block
346⎇⎇␈F1with⎇local⎇record⎇pointer⎇variables⎇does⎇NOT⎇cause⎇records⎇to⎇be⎇allocated⎇and⎇assigned⎇to⎇those
347⎇⎇␈F1variables.
348⎇⎇␈F16.5⎇-⎇␈F2SUBFIELDS␈F1
349⎇⎇␈F1Record⎇subfields⎇are⎇referenced⎇by⎇means⎇of⎇the⎇construct
350⎇⎇␈F1        <classid>:<fieldid>[<record pointer expression>]
351⎇⎇␈F1and⎇may⎇be⎇used⎇wherever⎇an⎇array⎇element⎇may⎇be⎇used.⎇ For⎇example
352⎇⎇␈F1        RECORD_POINTER(VECTOR) V;
353⎇⎇␈F1        RECORD_POINTER(CELL) C;
354⎇⎇␈F1        RECORD_POINTER(FOO) F;
355⎇⎇␈F1SAIL Addendum  1␈→979⎇243⎇1⎇0⎇⎇RECORD STRUCTURES␈←
356⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16444⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
357⎇⎇␈F1        :
358⎇⎇␈F1        VECTOR:X[V]←VECTOR:Y[V];
359⎇⎇␈F1        CELL:CAR[C←NEW_RECORD(CELL)]←V;
360⎇⎇␈F1        VECTOR:Z[V]←VECTOR:X[CELL:CAR[C]];
361⎇⎇␈F1        SUBLIS ← FOO:L[F][1 TO 3];
362⎇⎇␈F1        :
363⎇⎇␈F1If⎇the⎇<record⎇pointer⎇expression>⎇gives⎇a⎇null⎇record,⎇then⎇a⎇runtime⎇error⎇message⎇will⎇be
364⎇⎇␈F1generated.⎇ This⎇is⎇the⎇only⎇runtime⎇check⎇that⎇is⎇made⎇at⎇present.⎇ I.e.,⎇no⎇runtime⎇checks⎇are
365⎇⎇␈F1made⎇to⎇verify⎇that⎇the⎇<classid>⎇in⎇the⎇subfield⎇statement⎇matches⎇the⎇class⎇of⎇the⎇record
366⎇⎇␈F1whose⎇subfield⎇is⎇being⎇extracted.
367⎇⎇␈F1An⎇array⎇subfield⎇may⎇be⎇used⎇as⎇an⎇array⎇name,⎇as⎇in
368⎇⎇␈F1        RECORD_POINTER(TABLEAU) T;
369⎇⎇␈F1        :
370⎇⎇␈F1        TABLEAU:A[T][I,J] ← 2.5;
371⎇⎇␈F1provided⎇that⎇you⎇have⎇stored⎇a⎇valid⎇array⎇descriptor⎇into⎇the⎇subfield.⎇ Unfortunately,⎇SAIL
372⎇⎇␈F1does⎇not⎇provide⎇any⎇clean⎇way⎇to⎇do⎇this.⎇ One⎇unclean⎇way⎇is
373⎇⎇␈F1        INTEGER PROCEDURE NEWARY(INTEGER LB,UB);
374⎇⎇␈F1                BEGIN
375⎇⎇␈F1                INTEGER ARRAY A[LB:UB];
376⎇⎇␈F1                INTEGER AA;
377⎇⎇␈F1                AA←MEMORY[LOCATION(A)];
378⎇⎇␈F1                MEMORY[LOCATION(A)]←0;
379⎇⎇␈F1                         COMMENT defeats deallocation;
380⎇⎇␈F1                RETURN(AA);
381⎇⎇␈F1                END;
382⎇⎇␈F1        :
383⎇⎇␈F1        RECORD_CLASS FUBAR(INTEGER ARRAY A);
384⎇⎇␈F1        RECORD_POINTER(FUBAR) FB;
385⎇⎇␈F1        :
386⎇⎇␈F1        MEMORY[LOCATION(FUBAR:A[FB])]←NEWARY(1,100);
387⎇⎇␈F1(Warning:⎇the⎇above⎇"advice"⎇is⎇primarily⎇intended⎇for⎇hackers;⎇we⎇make⎇no⎇promisses⎇that⎇it⎇will
388⎇⎇␈F1never⎇get⎇you⎇into⎇trouble,⎇although⎇this⎇particular⎇trick⎇is⎇unlikely⎇to⎇be⎇made⎇obsolete⎇in⎇the
389⎇⎇␈F1forseeable⎇future).
390⎇⎇␈F1SAIL Addendum  1␈→979⎇243⎇1⎇0⎇⎇RECORD STRUCTURES␈←
391⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16445⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
392⎇⎇␈F16.6⎇-⎇␈F2GARBAGE⎇COLLECTION␈F1
393⎇⎇␈F1The⎇SAIL⎇record⎇service⎇routines⎇allocate⎇records⎇as⎇"small⎇blocks"⎇from⎇larger⎇"buffers"⎇of⎇free
394⎇⎇␈F1storage⎇obtained⎇from⎇the⎇normal⎇SAIL⎇free⎇storage⎇system.⎇(The⎇format⎇of⎇these⎇records⎇will⎇be
395⎇⎇␈F1discussed⎇in⎇a⎇later⎇section).⎇ From⎇time⎇to⎇time,⎇a⎇garbage⎇collector⎇is⎇called⎇to⎇reclaim⎇the
396⎇⎇␈F1storage⎇for⎇records⎇which⎇are⎇no⎇longer⎇accessible⎇by⎇the⎇user's⎇program⎇(i.e.,⎇are⎇not⎇pointed⎇to
397⎇⎇␈F1by⎇any⎇variables,⎇aren't⎇pointed⎇to⎇by⎇any⎇accessible⎇records,⎇etc.).⎇ The⎇garbage⎇collector⎇may⎇be
398⎇⎇␈F1called⎇explicitly⎇from⎇SAIL⎇programs⎇as⎇external⎇procedure⎇$RECGC,⎇and⎇automatic⎇invocation⎇of
399⎇⎇␈F1the⎇garbage⎇collection⎇may⎇be⎇inhibited⎇by⎇setting⎇user⎇table⎇entry⎇RGCOFF⎇to⎇TRUE.⎇(In⎇this
400⎇⎇␈F1case,⎇SAIL⎇will⎇just⎇keep⎇allocating⎇more⎇space,⎇with⎇nothing⎇being⎇reclaimed⎇until⎇RGCOFF⎇is⎇set
401⎇⎇␈F1back⎇to⎇FALSE⎇or⎇$RECGC⎇is⎇called⎇explicitly).⎇ In⎇addition,⎇SAIL⎇provides⎇a⎇number⎇of⎇"hooks"
402⎇⎇␈F1that⎇allow⎇a⎇user⎇to⎇control⎇the⎇automatic⎇invocation⎇of⎇the⎇garbage⎇collector.⎇ These⎇are
403⎇⎇␈F1discussed⎇in⎇a⎇subsequent⎇section.
404⎇⎇␈F16.7⎇-⎇␈F2INTERNAL⎇REPRESENTATIONS⎇␈F1
405⎇⎇␈F1Each⎇record⎇has⎇the⎇following⎇form:
406⎇⎇␈F1       -1:  <pointers to ring of all records of class>
407⎇⎇␈F1        0:  <garbage collector pointer>,,<pntr to class descriptor>
408⎇⎇␈F1        +1:     <first subfield>
409⎇⎇␈F1                      :
410⎇⎇␈F1        +n:     <last subfield>
411⎇⎇␈F1Record⎇ pointer⎇  variables⎇ point⎇ at⎇  word⎇ 0⎇ of⎇  such⎇ records.
412⎇⎇␈F1The⎇predefined⎇record⎇class⎇$CLASS⎇is⎇used⎇to⎇define⎇all⎇record⎇classes,⎇and⎇is⎇itself⎇a⎇record⎇of
413⎇⎇␈F1class⎇$CLASS.
414⎇⎇␈F1        RECORD_CLASS $CLASS (INTEGER RECRNG,HNDLER,RECSIZ;
415⎇⎇␈F1                                INTEGER ARRAY TYPARR;
416⎇⎇␈F1                                STRING ARRAY TXTARR);
417⎇⎇␈F1RECRNG⎇is⎇a⎇ring⎇(bidirectional⎇linked⎇list)⎇of⎇all⎇records⎇of⎇the⎇particular⎇class.
418⎇⎇␈F1HNDLER⎇is⎇a⎇pointer⎇to⎇the⎇handler⎇procedure⎇for⎇the⎇class⎇(default⎇$REC$).
419⎇⎇␈F1RECSIZ⎇is⎇the⎇number⎇of⎇subfields⎇in⎇the⎇class.
420⎇⎇␈F1TYPARR⎇is⎇an⎇array⎇of⎇subfield⎇descriptors⎇for⎇each⎇subfield⎇of⎇the⎇class.
421⎇⎇␈F1TXTARR⎇is⎇an⎇array⎇of⎇subfield⎇names⎇for⎇the⎇class.
422⎇⎇␈F1SAIL Addendum  1␈→979⎇243⎇1⎇0⎇⎇RECORD STRUCTURES␈←
423⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16448⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
424⎇⎇␈F1The⎇normal⎇ value⎇for⎇the⎇ handler⎇procedure⎇is⎇ $REC$,⎇which⎇ is⎇the⎇standard⎇procedure⎇ for
425⎇⎇␈F1such⎇ functions⎇as⎇ allocation,⎇deallocation,⎇etc.
426⎇⎇␈F1TYPARR⎇and⎇TXTARR⎇are⎇indexed⎇[0:RECSIZ].⎇ TXTARR[0]⎇is⎇the⎇name⎇of⎇the⎇record⎇class.
427⎇⎇␈F1TYPARR[0]⎇contains⎇type⎇bits⎇for⎇the⎇record⎇class.
428⎇⎇␈F1Example:
429⎇⎇␈F1        RECORD_CLASS FOO(LIST L;ITEMVAR A);
430⎇⎇␈F1The record class descriptor for FOO would contain:
431⎇⎇␈F1        FOO-1:  <pointers for ring of all records of $CLASS>
432⎇⎇␈F1        FOO:    <pointer to $CLASS>
433⎇⎇␈F1        FOO+1:  <pointers for ring of all records of class FOO
434⎇⎇␈F1                        initialized to <FOO+2,,FOO+2> >.
435⎇⎇␈F1        FOO+2:  <pointer to handler procedure: $REC$>
436⎇⎇␈F1        FOO+3:  2
437⎇⎇␈F1        FOO+4   <pointer to TYPARR>
438⎇⎇␈F1        FOO+5:  <pointer to TXTARR>
439⎇⎇␈F1The subfields of FOO will be:
440⎇⎇␈F1        $CLASS:RECRNG[FOO] = <initialized to null ring,
441⎇⎇␈F1                              i.e., xwd(loc(FOO)+2,loc(FOO)+22)>
442⎇⎇␈F1        $CLASS:HNDLER[FOO] = $REC$
443⎇⎇␈F1        $CLASS:RECSIZ[FOO] = 2
444⎇⎇␈F1        $CLASS:TXTARR[FOO] [0] = "FOO"
445⎇⎇␈F1        $CLASS:TXTARR[FOO] [1] = "L"
446⎇⎇␈F1        $CLASS:TXTARR[FOO] [2] = "A"
447⎇⎇␈F1        $CLASS:TYPARR[FOO] [0] = <magic bits for garbage collector>
448⎇⎇␈F1        $CLASS:TYPARR[FOO] [1] = <descriptor for LIST>
449⎇⎇␈F1        $CLASS:TYPARR[FOO] [2] = <descriptor for ITEMVAR>
450⎇⎇␈F1SAIL Addendum  1␈→979⎇243⎇1⎇0⎇⎇RECORD STRUCTURES␈←
451⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16449⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
452⎇⎇␈F16.8⎇-⎇␈F2HANDLER⎇PROCEDURES␈F1
453⎇⎇␈F1SAIL⎇uses⎇a⎇single⎇runtime⎇routine⎇$RECFN(OP,REC)⎇to⎇handle⎇such⎇system⎇functions⎇as⎇record
454⎇⎇␈F1allocation,⎇deallocation,⎇etc.⎇ For⎇instance,⎇the⎇construct
455⎇⎇␈F1        r ← NEW_RECORD(foo)
456⎇⎇␈F1is compiled as
457⎇⎇␈F1        PUSH    P,[1]
458⎇⎇␈F1        PUSH    P,[foo]
459⎇⎇␈F1        PUSHJ   P,$RECFN
460⎇⎇␈F1        MOVEM   1,r
461⎇⎇␈F1$RECFN⎇performs⎇a⎇certain⎇amount⎇of⎇type⎇checking⎇and⎇then⎇jumps⎇to⎇the⎇appropriate⎇handler
462⎇⎇␈F1procedure⎇for⎇the⎇class⎇being⎇operated⎇on.⎇ The⎇normal⎇value⎇for⎇this⎇handler⎇procedure⎇is⎇$REC$.
463⎇⎇␈F1It⎇is⎇possible⎇for⎇a⎇user⎇to⎇substitute⎇his⎇own⎇handler⎇procedure⎇for⎇a⎇given⎇class⎇of⎇records⎇by
464⎇⎇␈F1including⎇the⎇procedure⎇name⎇ in⎇brackets⎇after⎇the⎇record⎇class⎇declaration:
465⎇⎇␈F1        RECORD_CLASS <id> (<subfields>) [<handler>]
466⎇⎇␈F1This handler must have the form
467⎇⎇␈F1        RECORD_POINTER(ANY_CLASS) PROCEDURE <procid>
468⎇⎇␈F1                        (INTEGER OP;RECORD_POINTER(ANY_CLASS) R);
469⎇⎇␈F1Where⎇OP⎇ will⎇be⎇a⎇ small⎇integer⎇ saying⎇what⎇is⎇ to⎇be⎇ done.⎇ The⎇current⎇assignments⎇for⎇OP
470⎇⎇␈F1are:
471⎇⎇␈F1        OP value        meaning
472⎇⎇␈F1        0               invalid
473⎇⎇␈F1        1               allocate a new record of record class R
474⎇⎇␈F1        2               not used
475⎇⎇␈F1        3               not used
476⎇⎇␈F1        4               Mark all subfields of record R
477⎇⎇␈F1        5               Delete all space for record R
478⎇⎇␈F1Macro⎇definitions⎇for⎇these⎇functions⎇may⎇be⎇found⎇in⎇the⎇file⎇SYS:RECORD.DEF,⎇which⎇also
479⎇⎇␈F1includes⎇EXTERNAL⎇declarations⎇for⎇$CLASS,⎇$REC$,⎇and⎇$RECFN.
480⎇⎇␈F1$REC$(1,R)⎇allocates⎇a⎇record⎇of⎇the⎇record⎇class⎇specified⎇by⎇R,⎇which⎇must⎇be⎇a⎇record⎇of⎇class
481⎇⎇␈F1$CLASS.⎇ All⎇subfields⎇(except⎇string)⎇are⎇initialized⎇to⎇zero.⎇ String⎇subfields⎇are⎇initialized⎇to⎇a
482⎇⎇␈F1SAIL Addendum  1␈→979⎇243⎇1⎇0⎇⎇RECORD STRUCTURES␈←
483⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16451⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
484⎇⎇␈F1pointer⎇to⎇a⎇string⎇descriptor⎇with⎇length⎇zero⎇(null⎇string).
485⎇⎇␈F1$REC$(4,R)⎇is⎇used⎇by⎇the⎇garbage⎇collector⎇to⎇mark⎇all⎇record⎇subfields⎇of⎇R.
486⎇⎇␈F1$REC$(5,R)⎇deallocates⎇record⎇R,⎇and⎇deallocates⎇all⎇string⎇and⎇array⎇subfields⎇of⎇record⎇R.⎇ Care
487⎇⎇␈F1must⎇be⎇exercised⎇to⎇prevent⎇multiple⎇pointers⎇to⎇string⎇and⎇array⎇subfields,⎇ie.⎇DO⎇NOT⎇store
488⎇⎇␈F1the⎇location⎇of⎇an⎇array⎇in⎇subfields⎇of⎇two⎇different⎇records⎇unless⎇extreme⎇caution⎇is⎇taken⎇to
489⎇⎇␈F1handle⎇deletion.⎇ This⎇can⎇be⎇accomplished⎇through⎇user⎇handler⎇procedures⎇which⎇zero⎇array
490⎇⎇␈F1subfields⎇(without⎇actually⎇deleting⎇the⎇arrays)⎇prior⎇to⎇the⎇call⎇on⎇$REC$(5,R).
491⎇⎇␈F1NOTE:⎇ When⎇a⎇user⎇wishes⎇to⎇supply⎇his⎇own⎇handler⎇procedure,⎇he⎇must⎇be⎇careful⎇to⎇furnish
492⎇⎇␈F1all⎇the⎇necessary⎇functions.⎇ One⎇good⎇way⎇to⎇do⎇this⎇is⎇to⎇test⎇for⎇those⎇OPs⎇that⎇he⎇wishes⎇to
493⎇⎇␈F1handle⎇and⎇then⎇call⎇$REC$⎇for⎇all⎇the⎇rest.⎇ Also,⎇if⎇$REC$⎇was⎇used⎇to⎇allocate⎇space⎇for⎇the
494⎇⎇␈F1record⎇then⎇it⎇should⎇also⎇be⎇used⎇to⎇release⎇the⎇space.⎇ These⎇points⎇are⎇illustrated⎇by⎇the
495⎇⎇␈F1following⎇example:
496⎇⎇␈F1        RECORD_CLASS FOO(ITEMVAR IV)[FOOH];
497⎇⎇␈F1        RECORD_POINTER(ANY_CLASS) PROCEDURE FOOH(INTEGER OP;
498⎇⎇␈F1                                        RECORD_POINTER(ANY_CLASS) R);
499⎇⎇␈F1                BEGIN
500⎇⎇␈F1                OUTSTR("CALLING FOOH.  OP = "&CVS(OP));
501⎇⎇␈F1                IF OP = 1 THEN
502⎇⎇␈F1                        BEGIN
503⎇⎇␈F1                        RECORD_POINTER(FOO) F;
504⎇⎇␈F1                        F←$REC$(1,R);
505⎇⎇␈F1                        FOO:IV[F]←NEW;
506⎇⎇␈F1                        RETURN(F);
507⎇⎇␈F1                        END
508⎇⎇␈F1                ELSE IF OP = 5 THEN
509⎇⎇␈F1                        BEGIN
510⎇⎇␈F1                        DELETE(FOO:IV[R]);
511⎇⎇␈F1                        END;
512⎇⎇␈F1                RETURN($REC$(OP,R));
513⎇⎇␈F1                END;
514⎇⎇␈F1SAIL Addendum  1␈→979⎇243⎇1⎇0⎇⎇RECORD STRUCTURES␈←
515⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16452⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
516⎇⎇␈F16.9⎇-⎇␈F2STRING⎇SUBFIELDS␈F1
517⎇⎇␈F1String⎇subfields⎇presented⎇an⎇implementation⎇difficulty⎇due⎇to⎇the⎇fact⎇that⎇string⎇discriptors
518⎇⎇␈F1require⎇2⎇words,⎇but⎇record⎇subfields⎇are⎇exactly⎇one⎇word.⎇ This⎇problem⎇was⎇solved⎇by⎇making
519⎇⎇␈F1string⎇subfields⎇contain⎇a⎇pointer⎇to⎇the⎇descriptor⎇for⎇the⎇string⎇(like⎇REFERENCE⎇STRING
520⎇⎇␈F1formal⎇parameters).
521⎇⎇␈F1When⎇a⎇record⎇with⎇string⎇subfields⎇is⎇allocated⎇by⎇a⎇call⎇to⎇NEW_RECORD,⎇the⎇string⎇descriptor
522⎇⎇␈F1blocks⎇(2⎇words⎇each)⎇are⎇allocated⎇from⎇a⎇linked⎇list⎇of⎇free⎇string⎇descriptors.⎇ Likewise,⎇when
523⎇⎇␈F1a⎇record⎇is⎇deallocated⎇either⎇explicitly⎇or⎇by⎇the⎇garbage⎇collector,⎇the⎇string⎇subfield
524⎇⎇␈F1descriptors⎇are⎇released⎇to⎇the⎇free⎇list.⎇ The⎇free⎇list⎇is⎇automatically⎇expanded⎇when⎇exhausted.
525⎇⎇␈F16.10⎇-⎇␈F2MORE⎇ABOUT⎇GARBAGE⎇COLLECTION␈F1
526⎇⎇␈F1The⎇information⎇used⎇by⎇the⎇system⎇to⎇decide⎇when⎇to⎇call⎇$RECGC⎇on⎇its⎇own⎇is⎇accessible
527⎇⎇␈F1through⎇global⎇array,⎇$SPCAR.⎇ In⎇general,⎇$SPCAR[n]⎇points⎇at⎇a⎇"descriptor⎇block"⎇used⎇to
528⎇⎇␈F1control⎇the⎇allocation⎇of⎇small⎇blocks⎇of⎇n⎇words.⎇ This⎇descriptor⎇includes⎇the⎇following⎇fields:
529⎇⎇␈F1        BLKSIZ  -- number of words per block in this "space"
530⎇⎇␈F1        TRIGGER -- a counter used to control when to garbage collect
531⎇⎇␈F1        TGRMIN  -- described below.
532⎇⎇␈F1        TUNUSED -- number of unused blocks on the "free list"
533⎇⎇␈F1        TINUSE  -- total number of blocks "in use" for this space.
534⎇⎇␈F1        CULPRIT -- the number of times this space has caused
535⎇⎇␈F1                   collection.
536⎇⎇␈F1The⎇appropriate⎇macro⎇definitions⎇for⎇access⎇of⎇these⎇fields⎇may⎇be⎇found⎇in⎇the⎇source⎇file
537⎇⎇␈F1"SYS:RECORD.DEF".⎇ As⎇one⎇might⎇expect,⎇the⎇decision⎇to⎇invoke⎇the⎇garbage⎇collector⎇is⎇ made
538⎇⎇␈F1as⎇part⎇of⎇the⎇block⎇allocation⎇procedure,⎇which⎇works⎇(roughly)⎇as⎇follows:
539⎇⎇␈F1        INTEGER spc,size;
540⎇⎇␈F1        size ← $CLASS:RECSIZ[classid]+2;
541⎇⎇␈F1        IF size>16 THEN
542⎇⎇␈F1                return a CORGET block;
543⎇⎇␈F1        spc ← $SPCAR[size];
544⎇⎇␈F1        L1: IF (MEMORY[spc+TRIGGER]←MEMORY[spc+TRIGGER]-1) < 0 THEN
545⎇⎇␈F1                BEGIN
546⎇⎇␈F1                IF ¬MEMORY[GOGTAB+RGCOFF] THEN
547⎇⎇␈F1                        BEGIN
548⎇⎇␈F1                        MEMORY[spc+CULPRIT]←MEMORY[spc+CULPRIT]+1;
549⎇⎇␈F1SAIL Addendum  1␈→979⎇243⎇1⎇0⎇⎇RECORD STRUCTURES␈←
550⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16455⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
551⎇⎇␈F1                        $RECGC;
552⎇⎇␈F1                        GO TO L1;
553⎇⎇␈F1                        END;
554⎇⎇␈F1                END;
555⎇⎇␈F1        <allocate the block from space spc, update counters, etc.>
556⎇⎇␈F1Once⎇$RECGC⎇has⎇returned⎇all⎇unused⎇records⎇to⎇the⎇free⎇lists⎇associated⎇with⎇their⎇respective
557⎇⎇␈F1block⎇sizes,⎇it⎇must⎇adjust⎇the⎇trigger⎇levels⎇in⎇the⎇various⎇spaces.⎇ To⎇do⎇this,⎇it⎇first⎇looks⎇to
558⎇⎇␈F1see⎇if⎇the⎇user⎇has⎇specified⎇the⎇location⎇of⎇an⎇adjustment⎇procedure⎇in⎇TGRADJ(USER).⎇ If⎇this
559⎇⎇␈F1cell⎇is⎇non-zero,⎇then⎇$RECGC⎇calls⎇that⎇procedure⎇(which⎇must⎇have⎇no⎇parameters).⎇ Otherwise,
560⎇⎇␈F1it⎇calls⎇a⎇default⎇system⎇procedure⎇that⎇works⎇roughly⎇like⎇this:
561⎇⎇␈F1        <set all TRIGGER levels to -1>
562⎇⎇␈F1        FOR size ← 3 STEP 1 UNTIL 16 DO
563⎇⎇␈F1                BEGIN
564⎇⎇␈F1                spc ← $SPCAR[size];
565⎇⎇␈F1                IF MEMORY[spc+TRIGGER]<0 THEN
566⎇⎇␈F1                        BEGIN
567⎇⎇␈F1                        t←MEMORY[spc+TINUSE]*RGCRHO(USER);
568⎇⎇␈F1                        t←MAX(t,MEMORY[spc+TUNUSED],
569⎇⎇␈F1                                MEMORY[spc+TGRMIN]);
570⎇⎇␈F1                        END;
571⎇⎇␈F1                END;
572⎇⎇␈F1RGCRHO(USER)⎇is⎇a⎇real⎇number⎇currently⎇initialized⎇by⎇the⎇system⎇to⎇0.33.⎇ Thus,⎇users⎇can
573⎇⎇␈F1modify⎇the⎇behavior⎇or⎇SAIL's⎇automatic⎇garbage⎇collection⎇by⎇some⎇combination⎇of:
574⎇⎇␈F1        (1) Setting RGCOFF(USER).
575⎇⎇␈F1        (2) Supplying their own procedure in TGRADJ(USER).
576⎇⎇␈F1        (3) Modifying RGCRHO(USER).
577⎇⎇␈F1        (4) Modifying the TGRMIN entries in the space descriptors.
578⎇⎇␈F1One⎇word⎇of⎇caution:⎇User⎇procedures⎇that⎇set⎇trigger⎇levels⎇must⎇be⎇sure⎇not⎇to⎇leave⎇the
579⎇⎇␈F1trigger⎇level⎇of⎇the⎇space⎇that⎇caused⎇collection⎇to⎇be⎇set⎇to⎇zero.⎇ This⎇will⎇cause⎇a⎇runtime
580⎇⎇␈F1error⎇message⎇to⎇be⎇generated.
581⎇⎇␈F1␈→1069⎇0⎇2⎇0⎇⎇␈F2SECTION  7␈F1␈←
582⎇⎇␈F1SAIL Addendum  1␈→1213⎇243⎇1⎇0⎇⎇PRINT␈←
583⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16456⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
584⎇⎇␈F1␈→1169⎇0⎇2⎇0⎇⎇␈F2PRINT␈F1␈←
585⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇␈←
586⎇⎇␈F1SAIL⎇has⎇traditionally⎇had⎇very⎇flexible⎇input⎇and⎇output⎇that⎇allowed⎇the⎇user⎇essentially
587⎇⎇␈F1complete⎇access⎇to⎇the⎇time-sharing⎇system.⎇ Unfortunately,⎇some⎇of⎇the⎇simple⎇and⎇common
588⎇⎇␈F1things⎇that⎇the⎇user⎇wants⎇to⎇do⎇have⎇been⎇too⎇difficult⎇--⎇an⎇example⎇being⎇printing⎇output.
589⎇⎇␈F1Typically,⎇the⎇user⎇has⎇done⎇his⎇own⎇explicit⎇conversions⎇in⎇order⎇to⎇print⎇the⎇various⎇SAIL⎇data
590⎇⎇␈F1types.⎇ Thus,⎇the⎇following⎇is⎇an⎇example⎇of⎇the⎇coding⎇that⎇has⎇been⎇common.
591⎇⎇␈F1OUTSTR("The values are " & CVS(I) & " and " & CVG(X) &
592⎇⎇␈F1" for item " & CVIS(IT,JUNK));
593⎇⎇␈F1The⎇PRINT⎇statement⎇solves⎇this⎇by⎇printing⎇out⎇each⎇value⎇according⎇to⎇the⎇printing⎇format⎇for
594⎇⎇␈F1each⎇argument⎇and⎇allowing⎇an⎇indefinite⎇number⎇of⎇arguments,⎇each⎇of⎇which⎇is⎇separately⎇printed
595⎇⎇␈F1without⎇concatenation.⎇ Thus,⎇the⎇above⎇becomes:
596⎇⎇␈F1PRINT("The values are ",I,X," for item ",IT);
597⎇⎇␈F1The⎇PRINT⎇construction⎇is⎇both⎇clearer⎇and⎇more⎇efficient.⎇ The⎇first⎇example⎇has⎇the
598⎇⎇␈F1disadvantage⎇of⎇doing⎇unneeded⎇concatenation,⎇in⎇the⎇sense⎇that⎇the⎇string⎇really⎇doesn't⎇have⎇to
599⎇⎇␈F1be⎇created;⎇PRINT⎇avoids⎇unnecessary⎇concatenation⎇and⎇generally⎇compiles⎇less⎇in-line⎇code⎇as
600⎇⎇␈F1well.
601⎇⎇␈F17.1⎇-⎇␈F2Default⎇Formats⎇for⎇PRINT␈F1
602⎇⎇␈F1Each⎇syntactic⎇type⎇is⎇formatted⎇by⎇PRINT⎇in⎇a⎇standard⎇way⎇that⎇will⎇hopefully⎇satisfy⎇most
603⎇⎇␈F1users.⎇ Strings⎇are⎇simply⎇printed⎇out.⎇ Integers⎇use⎇the⎇function⎇CVS,⎇with⎇the⎇current
604⎇⎇␈F1SETFORMAT⎇positions.⎇ Reals⎇use⎇CVG,⎇also⎇with⎇the⎇current⎇SETFORMAT.
605⎇⎇␈F1Item⎇expressions⎇use⎇the⎇print⎇name⎇for⎇the⎇item⎇if⎇one⎇exists,⎇otherwise⎇ITEM!xxx,⎇where⎇xxx⎇is
606⎇⎇␈F1the⎇item⎇number.⎇ Sets⎇and⎇lists⎇are⎇printed⎇out⎇showing⎇their⎇item⎇components,⎇separated⎇by
607⎇⎇␈F1commas.⎇ Sets⎇are⎇surrounded⎇by⎇single⎇braces,⎇and⎇lists⎇by⎇double⎇braces.⎇ PHI⎇and⎇NIl⎇are⎇printed
608⎇⎇␈F1for⎇the⎇empty⎇set⎇and⎇empty⎇list⎇respectively.
609⎇⎇␈F1Record⎇pointers⎇are⎇printed⎇with⎇the⎇name⎇of⎇the⎇record⎇class,⎇followed⎇by⎇a⎇".",⎇followed⎇by⎇the
610⎇⎇␈F1SAIL Addendum  1␈→1213⎇243⎇1⎇0⎇⎇PRINT␈←
611⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16459⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
612⎇⎇␈F1address⎇in⎇decimal⎇of⎇the⎇record.⎇ NULL!RECORD⎇is⎇printed⎇for⎇the⎇empty⎇record.
613⎇⎇␈F1If⎇the⎇user⎇wants⎇some⎇other⎇format⎇for⎇a⎇given⎇syntactic⎇type,⎇it⎇is⎇easy⎇to⎇make⎇a⎇function⎇call
614⎇⎇␈F1as⎇the⎇argument⎇to⎇the⎇PRINT⎇statement.⎇ For⎇example,
615⎇⎇␈F1PRINT(CVOS(I));
616⎇⎇␈F1will⎇print⎇out⎇I⎇in⎇octal,⎇since⎇CVOS⎇is⎇first⎇called.⎇ (The⎇syntactic⎇type⎇of⎇the⎇expression
617⎇⎇␈F1CVOS(I)⎇is⎇of⎇course⎇STRING.)
618⎇⎇␈F1There⎇is⎇also⎇a⎇way⎇to⎇entirely⎇change⎇the⎇default⎇formatting⎇function⎇for⎇a⎇given⎇syntactic⎇type.
619⎇⎇␈F1It⎇is⎇described⎇below,⎇but⎇is⎇considered⎇to⎇be⎇for⎇wizards⎇only.
620⎇⎇␈F17.2⎇-⎇␈F2SETPRINT⎇and⎇GETPRINT␈F1
621⎇⎇␈F1The⎇SETPRINT⎇function⎇sets⎇the⎇destination⎇of⎇the⎇output⎇from⎇the⎇PRINT⎇statement.⎇ Initially,
622⎇⎇␈F1the⎇PRINT⎇statement⎇is⎇set⎇to⎇output⎇to⎇the⎇user's⎇terminal.⎇ This⎇may⎇be⎇changed⎇to⎇be⎇to⎇a⎇file
623⎇⎇␈F1or⎇to⎇both⎇the⎇terminal⎇and⎇a⎇file.
624⎇⎇␈F1The⎇call⎇to⎇SETPRINT⎇is⎇as⎇follows:
625⎇⎇␈F1␈→827⎇0⎇2⎇0⎇⎇SETPRINT("FILE!NAME", "MODE")␈←
626⎇⎇␈F1The⎇file⎇name⎇is⎇a⎇(possibly⎇empty)⎇name⎇for⎇a⎇file⎇to⎇which⎇the⎇PRINTed⎇text⎇is⎇to⎇be⎇printed.
627⎇⎇␈F1"MODE"⎇is⎇a⎇single⎇character⎇indicating⎇how⎇the⎇PRINT⎇statement⎇is⎇to⎇function.⎇ SETPRINT⎇may
628⎇⎇␈F1be⎇called⎇many⎇times⎇--⎇it⎇is⎇a⎇procedure⎇with⎇dynamic⎇effects,⎇not⎇a⎇declaration.
629⎇⎇␈F1   Character    Meaning
630⎇⎇␈F1   ---------------------------
631⎇⎇␈F1        T       the Terminal gets all PRINT output.  if an
632⎇⎇␈F1                output file is open, it is to be closed.  T is
633⎇⎇␈F1                the default mode in which PRINT is initialized.
634⎇⎇␈F1        F       File gets PRINT output.  If no file is open, it
635⎇⎇␈F1                will be opened, as described below.
636⎇⎇␈F1        B       Both terminal and file get PRINT output.  if
637⎇⎇␈F1                no file is open, it should be opened.
638⎇⎇␈F1        N       Neither the file nor the terminal is getting any
639⎇⎇␈F1                output.  if a file is open, it will be closed.
640⎇⎇␈F1        S       suppress all output, but open a file if none is
641⎇⎇␈F1                open.
642⎇⎇␈F1SAIL Addendum  1␈→1213⎇243⎇1⎇0⎇⎇PRINT␈←
643⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16461⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
644⎇⎇␈F1        O       a file is Open, but the terminal is getting all
645⎇⎇␈F1                output.  opens a file if none is open.
646⎇⎇␈F1        C       terminal gets output, but ignore whether or not
647⎇⎇␈F1                file is open and whether or not file is getting
648⎇⎇␈F1                output.
649⎇⎇␈F1        I       terminal does not get output.  ignore whether or
650⎇⎇␈F1                not a file is open and whether or not file is
651⎇⎇␈F1                getting any output.
652⎇⎇␈F1The⎇first⎇6⎇possibilities⎇represent⎇the⎇logically⎇possible⎇states⎇in⎇which⎇the⎇PRINT⎇system⎇can⎇be.
653⎇⎇␈F1These⎇are⎇therefore⎇the⎇letters⎇returned⎇by⎇GETPRINT⎇below.⎇ The⎇"C"⎇and⎇"I"⎇modes⎇are⎇added
654⎇⎇␈F1for⎇convenience,⎇so⎇that⎇it⎇is⎇possible⎇to⎇terminal⎇output⎇on⎇and⎇off⎇without⎇bothering⎇to⎇check,
655⎇⎇␈F1with⎇GETPRINT,⎇the⎇current⎇state⎇of⎇the⎇output.
656⎇⎇␈F1The⎇PRINT⎇statement⎇is⎇initialized⎇to⎇mode⎇"T"⎇--⎇print⎇to⎇Terminal.⎇ The⎇user⎇will⎇probably⎇find
657⎇⎇␈F1modes⎇"T",⎇"F"⎇and⎇"B"⎇to⎇be⎇the⎇most⎇useful.⎇ The⎇other⎇modes⎇are⎇included⎇for⎇completeness⎇of
658⎇⎇␈F1the⎇system,⎇and⎇to⎇allow⎇the⎇user⎇to⎇switch⎇between⎇various⎇combinations⎇dynamically.
659⎇⎇␈F1Should⎇SETPRINT⎇be⎇called⎇in⎇such⎇a⎇way⎇that⎇a⎇file⎇has⎇to⎇be⎇opened⎇--⎇e.g.,⎇mode⎇"F"⎇and⎇no
660⎇⎇␈F1file⎇is⎇open⎇--⎇then⎇the⎇first⎇argument⎇to⎇SETPRINT⎇will⎇be⎇used⎇ss⎇the⎇name⎇for⎇the⎇output⎇file.
661⎇⎇␈F1If⎇the⎇filename⎇argument⎇is⎇NULL,⎇then⎇the⎇filename⎇will⎇be⎇obtained⎇from⎇the⎇terminal.⎇ Thus,⎇the
662⎇⎇␈F1statement:
663⎇⎇␈F1SETPRINT(NULL,"F");
664⎇⎇␈F1first⎇types⎇out⎇the⎇message
665⎇⎇␈F1File for PRINT output  *
666⎇⎇␈F1and⎇then⎇waits⎇for⎇the⎇user⎇to⎇type⎇a⎇filename,⎇and⎇then⎇opens⎇such⎇a⎇file.⎇ On⎇TENEX,⎇GTJFN
667⎇⎇␈F1with⎇filename⎇recognition⎇is⎇used⎇here.⎇ On⎇the⎇DEC⎇system⎇and⎇its⎇variants,⎇the⎇filename⎇is⎇read
668⎇⎇␈F1in⎇with⎇the⎇INCHWL⎇routine.
669⎇⎇␈F1The⎇file⎇opened⎇by⎇SETPRINT⎇will⎇be⎇closed⎇when⎇the⎇program⎇terminates⎇by⎇falling⎇through⎇the
670⎇⎇␈F1bottom.⎇ It⎇will⎇also⎇be⎇closed⎇if⎇the⎇user⎇calls⎇SETPRINT⎇with⎇some⎇mode⎇that⎇closes⎇the⎇file⎇--
671⎇⎇␈F1e.g.,⎇"T"⎇will⎇close⎇an⎇output⎇file⎇if⎇one⎇is⎇open.
672⎇⎇␈F1To⎇determine⎇the⎇current⎇mode⎇of⎇the⎇PRINT⎇system,⎇the⎇user⎇can⎇call⎇GETPRINT,⎇which⎇returns
673⎇⎇␈F1a⎇letter⎇indicating⎇which⎇of⎇the⎇modes⎇is⎇currently⎇set,⎇using⎇the⎇same⎇coding⎇as⎇SETPRINT⎇above.
674⎇⎇␈F1Thus,⎇the⎇call⎇is
675⎇⎇␈F1        "MODE" ← GETPRINT;
676⎇⎇␈F1SAIL Addendum  1␈→1213⎇243⎇1⎇0⎇⎇PRINT␈←
677⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16462⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
678⎇⎇␈F1SETPRINT⎇and⎇GETPRINT⎇are⎇related⎇only⎇to⎇the⎇PRINT⎇statement⎇and⎇do⎇not⎇effect⎇CPRINT
679⎇⎇␈F1below.
680⎇⎇␈F17.3⎇-⎇␈F2Simple⎇Uses⎇of⎇PRINT⎇and⎇SETPRINT␈F1
681⎇⎇␈F1We⎇provide⎇a⎇few⎇examples⎇of⎇common⎇output⎇situations.
682⎇⎇␈F11)⎇ PRINT⎇to⎇TERMINAL.⎇ Just⎇call⎇PRINT⎇with⎇your⎇output,⎇don't⎇bother⎇with⎇SETPRINT.
683⎇⎇␈F12)⎇ PRINT⎇to⎇FILE.⎇ Call
684⎇⎇␈F1SETPRINT(NULL,"F");
685⎇⎇␈F1and⎇type⎇the⎇name⎇of⎇the⎇output⎇file,⎇at⎇runtime,⎇when⎇it⎇asks.
686⎇⎇␈F13)⎇ PRINT⎇to⎇FILE⎇and⎇TERMINAL.⎇ Call,⎇at⎇the⎇beginning⎇of⎇your⎇program,
687⎇⎇␈F1SETPRINT(NULL,"B");
688⎇⎇␈F1and⎇type⎇the⎇name⎇when⎇asked.
689⎇⎇␈F14)⎇ PRINT⎇to⎇FILE⎇always⎇and⎇sometimes⎇also⎇to⎇TERMINAL.⎇ Call,⎇at⎇the⎇beginning
690⎇⎇␈F1SETPRINT(NULL,"B");
691⎇⎇␈F1and⎇give⎇the⎇name⎇of⎇the⎇file⎇when⎇it⎇asks.⎇ This⎇sets⎇output⎇to⎇both⎇the⎇terminal⎇and⎇the⎇file.
692⎇⎇␈F1Now,⎇to⎇ignore⎇the⎇terminal⎇(leaving⎇the⎇file⎇alone),⎇call
693⎇⎇␈F1SETPRINT(NULL,"I");
694⎇⎇␈F1Likewise,⎇to⎇turn⎇the⎇teletype⎇back⎇on,⎇call
695⎇⎇␈F1SETPRINT(NULL,"C");
696⎇⎇␈F1SAIL Addendum  1␈→1213⎇243⎇1⎇0⎇⎇PRINT␈←
697⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16464⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
698⎇⎇␈F1This⎇is⎇useful⎇for⎇obtaining⎇a⎇cleaned-up⎇printout⎇on⎇the⎇file,⎇with⎇error⎇messages⎇going⎇to⎇the
699⎇⎇␈F1terminal.
700⎇⎇␈F1The⎇use⎇of⎇GETPRINT⎇to⎇determine⎇the⎇current⎇state⎇allows⎇more⎇complex⎇possibilities.
701⎇⎇␈F17.4⎇-⎇␈F2CPRINT⎇--⎇Printing⎇to⎇a⎇Channel␈F1
702⎇⎇␈F1CPRINT⎇is⎇similar⎇to⎇PRINT⎇except⎇that⎇the⎇first⎇argument⎇is⎇assumed⎇to⎇be⎇a⎇SAIL⎇channel
703⎇⎇␈F1number.⎇ CPRINT⎇then⎇dispatches⎇to⎇the⎇file⎇the⎇appropriate⎇printed⎇formats⎇of⎇the⎇rest⎇of⎇the
704⎇⎇␈F1arguments.⎇ Thus,⎇the⎇following⎇are⎇functionally⎇equivalent:
705⎇⎇␈F1CPRINT(CHAN,"The value are ",I," and ",X);
706⎇⎇␈F1OUT(CHAN,"The values are " & CVS(I) & " and " & CVG(X));
707⎇⎇␈F1The⎇user⎇is⎇responsible⎇for⎇obtaining⎇and⎇releasing⎇the⎇channel⎇for⎇the⎇CPRINT⎇statement.⎇ As⎇a
708⎇⎇␈F1very⎇simple⎇example⎇on⎇the⎇DEC⎇system:
709⎇⎇␈F1OUTSTR("Type output file name  *");
710⎇⎇␈F1OPEN(CHAN ← GETCHAN,"DSK",0,0,2,0,0,0);
711⎇⎇␈F1ENTER(CHAN,INCHWL,FLAG);
712⎇⎇␈F1IF FLAG THEN USERERR(0,0,"CANNOT GET FILE ON DISK");
713⎇⎇␈F1or⎇for⎇TENEX:
714⎇⎇␈F1OUTSTR("Type output file name  *");
715⎇⎇␈F1CHAN ← OPENFILE(NULL,"W");
716⎇⎇␈F1The⎇statement⎇RELEASE(CHAN)⎇on⎇DEC⎇or⎇CFILE(CHAN)⎇on⎇TENEX⎇will⎇close⎇and⎇release⎇the
717⎇⎇␈F1device/file⎇open⎇on⎇CHAN.
718⎇⎇␈F1SAIL Addendum  1␈→1213⎇243⎇1⎇0⎇⎇PRINT␈←
719⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16466⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
720⎇⎇␈F17.5⎇-⎇␈F2Design⎇of⎇PRINT␈F1
721⎇⎇␈F1The⎇PRINT⎇statement⎇was⎇designed⎇for⎇those⎇who⎇miss⎇the⎇ALGOL⎇W⎇WRITE⎇and⎇WRITEON
722⎇⎇␈F1statements,⎇especially⎇for⎇new⎇SAIL⎇users⎇who⎇currently⎇have⎇to⎇learn⎇too⎇much⎇about⎇type
723⎇⎇␈F1conversion⎇and⎇file⎇manipulation⎇to⎇write⎇simple⎇SAIL⎇programs.⎇ Notice⎇that⎇SAIL⎇doesn't⎇need
724⎇⎇␈F1both⎇WRITE⎇and⎇WRITEON,⎇since⎇manipulating⎇lines⎇can⎇be⎇done⎇from⎇SAIL⎇by⎇printing⎇out
725⎇⎇␈F1formatting⎇characters.⎇ We⎇recommend⎇the⎇following⎇macro
726⎇⎇␈F1DEFINE CRLF="('15 & '12)";
727⎇⎇␈F1which⎇the⎇user⎇may⎇define⎇to⎇mean⎇"carriage⎇return⎇-⎇line⎇feed".⎇ Thus,
728⎇⎇␈F1PRINT(CRLF,"Hi There");
729⎇⎇␈F1is equivalent to the ALGOL W
730⎇⎇␈F1WRITE("Hi There");
731⎇⎇␈F1A⎇READ⎇statement⎇was⎇also⎇considered⎇for⎇implementation.⎇ The⎇difficulty⎇lies⎇in⎇defining⎇how
732⎇⎇␈F1strings⎇are⎇input.⎇ SAIL⎇has⎇very⎇extensive⎇input⎇facilities,⎇including⎇break⎇tables,⎇which⎇do⎇many
733⎇⎇␈F1of⎇the⎇common⎇scanning⎇operation.
734⎇⎇␈F1Further⎇consideration⎇was⎇given⎇to⎇a⎇template-driven⎇printing⎇function.⎇ This⎇proved⎇to⎇be⎇both
735⎇⎇␈F1inefficient⎇in⎇implementation,⎇and⎇an⎇added⎇overhead⎇to⎇an⎇already⎇large⎇runtime⎇system.
736⎇⎇␈F17.6⎇-⎇␈F2CAVEATS⎇of⎇PRINT⎇and⎇CPRINT␈F1
737⎇⎇␈F1A⎇problem⎇with⎇the⎇PRINT⎇construction,⎇especially⎇for⎇experienced⎇SAIL⎇users,⎇is⎇likely⎇to⎇occur
738⎇⎇␈F1when⎇the⎇user⎇trys⎇to⎇exploit⎇the⎇normal⎇SAIL⎇type⎇conversions⎇in⎇the⎇printing⎇of⎇strings.⎇ This
739⎇⎇␈F1is⎇especially⎇common⎇when⎇the⎇user⎇wants⎇to⎇print⎇out⎇ASCII⎇characters.⎇ One⎇often⎇uses⎇a
740⎇⎇␈F1number⎇(i.e.,⎇an⎇INTEGER⎇expression)⎇that,⎇upon⎇default⎇type⎇conversion,⎇becomes⎇a⎇one-character
741⎇⎇␈F1string.⎇ Thus,
742⎇⎇␈F1OUTSTR(12)
743⎇⎇␈F1prints⎇a⎇form-feed⎇onto⎇the⎇terminal,⎇whereas
744⎇⎇␈F1PRINT(12)
745⎇⎇␈F1SAIL Addendum  1␈→1213⎇243⎇1⎇0⎇⎇PRINT␈←
746⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16469⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
747⎇⎇␈F1prints⎇"12"⎇onto⎇the⎇terminal.⎇ The⎇reason,⎇of⎇course,⎇is⎇the⎇default⎇formatting⎇for⎇integers⎇under
748⎇⎇␈F1PRINT⎇or⎇CPRINT.
749⎇⎇␈F1This⎇problem⎇is⎇especially⎇confusing⎇with⎇macros⎇that⎇have⎇been⎇defined⎇with⎇an⎇integer⎇to
750⎇⎇␈F1represent⎇an⎇ASCII⎇character.⎇ For⎇example,
751⎇⎇␈F1DEFINE TAB="'11";
752⎇⎇␈F1will⎇present⎇the⎇same⎇problem.⎇ The⎇solution⎇is⎇to⎇define⎇the⎇macro⎇so⎇that⎇it⎇expands⎇to⎇a
753⎇⎇␈F1STRING⎇constant⎇rather⎇than⎇an⎇integer.
754⎇⎇␈F1Also,⎇beware⎇that⎇the⎇first⎇argument⎇to⎇CPRINT⎇is⎇the⎇channel⎇number.
755⎇⎇␈F17.7⎇-⎇␈F2Hooks⎇into⎇the⎇PRINT⎇System␈F1
756⎇⎇␈F1[This⎇section⎇is⎇for⎇wizards⎇only.]
757⎇⎇␈F1As⎇is⎇traditional⎇with⎇SAIL,⎇there⎇are⎇user⎇hooks⎇to⎇get⎇hold⎇of⎇the⎇operation⎇of⎇the⎇PRINT
758⎇⎇␈F1system.⎇ These⎇hooks⎇are⎇obtained⎇by⎇setting⎇certain⎇cells⎇of⎇the⎇user⎇table⎇to⎇the⎇addresses⎇of
759⎇⎇␈F1SIMPLE⎇PROCEDURES⎇that⎇the⎇user⎇has⎇written.
760⎇⎇␈F1All⎇output⎇going⎇to⎇either⎇the⎇PRINT⎇or⎇CPRINT⎇statements⎇can⎇be⎇trapped⎇by⎇setting⎇user⎇table
761⎇⎇␈F1entry⎇$$PROU⎇to⎇the⎇address⎇of⎇a⎇SIMPLE⎇procedure⎇that⎇has⎇one⎇string⎇and⎇one⎇integer
762⎇⎇␈F1argument,⎇e.g.,
763⎇⎇␈F1SIMPLE PROCEDURE MYPRINT(INTEGER CHAN; STRING S)
764⎇⎇␈F1The⎇user⎇could⎇set⎇this⎇up⎇by⎇the⎇assignment
765⎇⎇␈F1GOGTAB[$$PROU] ← LOCATION(MYPRINT);
766⎇⎇␈F1(See⎇below⎇in⎇this⎇manual⎇for⎇a⎇description⎇of⎇the⎇GOGTAB⎇array⎇as⎇a⎇way⎇of⎇accessing⎇the⎇user
767⎇⎇␈F1table.)
768⎇⎇␈F1The⎇CHAN⎇argument⎇is⎇then⎇either⎇the⎇CHAN⎇argument⎇for⎇CPRINT,⎇or⎇-1⎇for⎇PRINT.⎇ If⎇this
769⎇⎇␈F1SAIL Addendum  1␈→1213⎇243⎇1⎇0⎇⎇PRINT␈←
770⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16471⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
771⎇⎇␈F1trap⎇is⎇set⎇up,⎇all⎇output⎇from⎇PRINT⎇and⎇CPRINT⎇goes⎇through⎇the⎇user⎇routine,⎇and⎇is⎇not
772⎇⎇␈F1printed⎇(unless⎇the⎇user⎇invokes⎇OUT⎇or⎇OUTSTR⎇from⎇within⎇the⎇trap⎇routine⎇itself.)
773⎇⎇␈F1To⎇trap⎇the⎇formatting⎇function⎇for⎇any⎇syntactic⎇type,⎇the⎇user⎇should⎇set⎇the⎇appropriate⎇user
774⎇⎇␈F1table⎇address⎇to⎇the⎇location⎇of⎇a⎇function⎇that⎇returns⎇a⎇string⎇and⎇takes⎇as⎇an⎇argument⎇the
775⎇⎇␈F1syntactic⎇type⎇in⎇question.⎇ For⎇example,⎇if⎇the⎇user⎇wanted⎇to⎇trap⎇integer⎇printing⎇and⎇print⎇all
776⎇⎇␈F1integers⎇out⎇in⎇octal,⎇preceded⎇by⎇a⎇"'",⎇he⎇could⎇do⎇the⎇following:
777⎇⎇␈F1SIMPLE STRING PROCEDURE MYCVOS(INTEGER I);
778⎇⎇␈F1RETURN("'" & CVOS(I));
779⎇⎇␈F1GOGTAB[$$FINT] ← LOCATION(MYCVOS);
780⎇⎇␈F1The⎇names⎇for⎇the⎇addresses⎇in⎇the⎇user⎇table⎇associated⎇with⎇each⎇formatting⎇function⎇are:
781⎇⎇␈F1User table index        for syntactic type
782⎇⎇␈F1-----------------------------------------
783⎇⎇␈F1$$FINT                  INTEGER
784⎇⎇␈F1$$FREL                  REAL
785⎇⎇␈F1$$FITM                  ITEM
786⎇⎇␈F1$$FSET                  SET
787⎇⎇␈F1$$FLST                  LIST
788⎇⎇␈F1$$FSTR                  STRING
789⎇⎇␈F1$$FREC                  RECORD!POINTER
790⎇⎇␈F1To⎇restore⎇any⎇formatting⎇function⎇to⎇the⎇default⎇provided⎇by⎇the⎇PRINT⎇system,⎇the⎇user⎇should
791⎇⎇␈F1zero⎇the⎇appropriate⎇address⎇of⎇the⎇user⎇table.
792⎇⎇␈F1␈→1069⎇0⎇2⎇0⎇⎇␈F2SECTION  8␈F1␈←
793⎇⎇␈F1SAIL Addendum  1␈→1048⎇243⎇1⎇0⎇⎇SAVE/CONTINUE␈←
794⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16472⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
795⎇⎇␈F1␈→963⎇0⎇2⎇0⎇⎇␈F2SAVE/CONTINUE␈F1␈←
796⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇␈←
797⎇⎇␈F1A⎇save/continue⎇facility⎇has⎇been⎇implemented⎇in⎇the⎇SAIL⎇compiler.⎇ This⎇allows⎇compiling
798⎇⎇␈F1header⎇files,⎇saving⎇the⎇state⎇of⎇the⎇compiler,⎇and⎇resuming⎇compilation⎇at⎇a⎇later⎇time.⎇ The
799⎇⎇␈F1save/continue⎇facility⎇works⎇with⎇files⎇as⎇the⎇basic⎇unit;⎇compilation⎇can⎇be⎇interrupted⎇only⎇at
800⎇⎇␈F1the⎇end⎇of⎇a⎇file.⎇ The⎇/X⎇(eXtend)⎇switch⎇controls⎇the⎇new⎇feature.⎇ The⎇examples⎇shown⎇here
801⎇⎇␈F1are⎇for⎇the⎇DEC⎇timesharing⎇system.⎇ Analogous⎇commands⎇work⎇under⎇TENEX,⎇using⎇the⎇TENEX
802⎇⎇␈F1RUN⎇and⎇SAVE⎇commands.⎇ The⎇dialog⎇is⎇similar,⎇except⎇that⎇the⎇TENEX⎇command⎇language⎇format
803⎇⎇␈F1is⎇followed⎇on⎇TENEX.⎇ Example:
804⎇⎇␈F1.R SAIL
805⎇⎇␈F1*INTRMD.REL[PRJ,PRG]←A,B,C/X
806⎇⎇␈F1 A.SAI 1 etc.
807⎇⎇␈F1SAVE ME FOR USE AS XSAIL.
808⎇⎇␈F1EXIT
809⎇⎇␈F1.SAVE XSAIL
810⎇⎇␈F1JOB SAVED IN 25K
811⎇⎇␈F1UPPER NOT SAVED!
812⎇⎇␈F1.RU XSAIL
813⎇⎇␈F1*FINAL←D,E,F
814⎇⎇␈F1 D.SAI
815⎇⎇␈F1Copying DSK:INTRMD.REL[PRJ,PRG]
816⎇⎇␈F1 2 3 etc.
817⎇⎇␈F1*↑C
818⎇⎇␈F1The above is equivalent to
819⎇⎇␈F1.R SAIL
820⎇⎇␈F1*FINAL←A,B,C,D,E,F
821⎇⎇␈F1On⎇TENEX,⎇the⎇user⎇will⎇want⎇to⎇save⎇core⎇from⎇20⎇to⎇577777⎇in⎇creating⎇the⎇XSAIL.SAV⎇file.
822⎇⎇␈F1Information⎇is⎇saved⎇in⎇XSAIL.SAV⎇and⎇in⎇the⎇binary⎇file⎇from⎇the⎇first⎇"compilation"⎇(in⎇this⎇case
823⎇⎇␈F1INTRMD.REL).⎇ When⎇compilation⎇is⎇resumed,⎇the⎇final⎇binary⎇file⎇is⎇initialized⎇by⎇copying⎇the
824⎇⎇␈F1intermediate⎇file.
825⎇⎇␈F1Save/continue⎇is⎇not⎇allowed⎇if⎇the⎇file⎇break⎇occurs⎇while⎇scanning⎇false⎇conditional⎇compilation
826⎇⎇␈F1SAIL Addendum  1␈→1048⎇243⎇1⎇0⎇⎇SAVE/CONTINUE␈←
827⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16474⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
828⎇⎇␈F1or⎇actual⎇parameters⎇to⎇a⎇macro⎇call.
829⎇⎇␈F1A⎇hint⎇on⎇using⎇this⎇feature:⎇ If⎇the⎇source⎇term⎇of⎇your⎇command⎇string⎇consists⎇of⎇just⎇one⎇file,
830⎇⎇␈F1and⎇this⎇one⎇file⎇does⎇REQUIREs⎇of⎇other⎇source⎇files,⎇the⎇following⎇setup⎇works⎇well.
831⎇⎇␈F1Original file FOO.SAI:
832⎇⎇␈F1        BEGIN "FOO"
833⎇⎇␈F1          REQUIRE "[][]" DELIMITERS;
834⎇⎇␈F1          DEFINE !=[COMMENT];
835⎇⎇␈F1          REQUIRE "BAZ.SAI" SOURCE_FILE;
836⎇⎇␈F1          REQUIRE "MUMBLE.SAI" SOURCE_FILE;
837⎇⎇␈F1          :
838⎇⎇␈F1          <rest of file>
839⎇⎇␈F1          :
840⎇⎇␈F1        END "FOO"
841⎇⎇␈F1New file FOO.SAI:
842⎇⎇␈F1    IFCR NOT DECLARATION(GARPLY) THENC
843⎇⎇␈F1        BEGIN "FOO"
844⎇⎇␈F1          REQUIRE "[][]" DELIMITERS;
845⎇⎇␈F1    DEFINE GARPLY=TRUE;
846⎇⎇␈F1          DEFINE !=[COMMENT];
847⎇⎇␈F1          REQUIRE "BAZ.SAI" SOURCE_FILE;
848⎇⎇␈F1          REQUIRE "MUMBLE.SAI" SOURCE_FILE;
849⎇⎇␈F1    ENDC;
850⎇⎇␈F1          :
851⎇⎇␈F1          <rest of file>
852⎇⎇␈F1          :
853⎇⎇␈F1        END "FOO"
854⎇⎇␈F1New file FOO.HDR:
855⎇⎇␈F1    IFCR NOT DECLARATION(GARPLY) THENC
856⎇⎇␈F1        BEGIN "FOO"
857⎇⎇␈F1          REQUIRE "[][]" DELIMITERS;
858⎇⎇␈F1    DEFINE GARPLY=TRUE;
859⎇⎇␈F1          DEFINE !=[COMMENT];
860⎇⎇␈F1          REQUIRE "BAZ.SAI" SOURCE_FILE;
861⎇⎇␈F1          REQUIRE "MUMBLE.SAI" SOURCE_FILE;
862⎇⎇␈F1    ENDC;
863⎇⎇␈F1Initial compilation:
864⎇⎇␈F1SAIL Addendum  1␈→1048⎇243⎇1⎇0⎇⎇SAVE/CONTINUE␈←
865⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16475⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
866⎇⎇␈F1    .R SAIL
867⎇⎇␈F1    *FOO.INT[PRJ,PRG]←FOO.HDR/X
868⎇⎇␈F1    SAVE ME!
869⎇⎇␈F1    .SAV XSAIL
870⎇⎇␈F1Now the command string
871⎇⎇␈F1    FOO←FOO
872⎇⎇␈F1will work both in the case of .R SAIL and in the case .RU XSAIL.
873⎇⎇␈F1␈→1069⎇0⎇2⎇0⎇⎇␈F2SECTION  9␈F1␈←
874⎇⎇␈F1SAIL Addendum  1␈→819⎇243⎇1⎇0⎇⎇MISCELLANEOUS NEW FEATURES␈←
875⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16476⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
876⎇⎇␈F1␈→625⎇0⎇2⎇0⎇⎇␈F2MISCELLANEOUS NEW FEATURES␈F1␈←
877⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇␈←
878⎇⎇␈F19.1⎇-⎇␈F2NEW⎇MTAPE⎇OPTIONS␈F1
879⎇⎇␈F1        MTAPE(chan,NULL)
880⎇⎇␈F1will⎇cause⎇an⎇MTAPE⎇0⎇to⎇be⎇issued⎇for⎇channel⎇chan.⎇ For⎇mag.⎇tapes,⎇this⎇will⎇cause⎇you⎇to⎇wait
881⎇⎇␈F1until⎇all⎇activity⎇ceases.⎇ For⎇other⎇devices,⎇various⎇random⎇things⎇can⎇happen,⎇depending⎇on⎇the
882⎇⎇␈F1device⎇and⎇system.
883⎇⎇␈F1In⎇export⎇SAIL,⎇MTAPE(chnl,"I")⎇sets⎇the⎇'IBM⎇compatible'⎇mode⎇for⎇a⎇tape⎇drive.⎇ (It⎇does⎇an
884⎇⎇␈F1MTAPE⎇chnl,101.)
885⎇⎇␈F1These⎇features⎇do⎇not⎇work⎇in⎇TENEX⎇SAIL.⎇ Full⎇access⎇to⎇TENEX⎇magtapes⎇is⎇obtained⎇through
886⎇⎇␈F1the⎇MTOPR,⎇GDSTS⎇and⎇SDSTS⎇routines,⎇which⎇are⎇TENEX-only⎇runtimes.
887⎇⎇␈F19.2⎇-⎇␈F2INITIALIZATION⎇PHASES␈F1
888⎇⎇␈F1User⎇initializations⎇ are⎇ now⎇done⎇ in⎇successive⎇ phases,⎇with⎇ all⎇initializations⎇  required⎇  for
889⎇⎇␈F1one⎇  phase⎇  being⎇ done⎇  before⎇initializations⎇required⎇for⎇the⎇next⎇phase.
890⎇⎇␈F1Syntax:
891⎇⎇␈F1        REQUIRE <procid> INITIALIZATION;
892⎇⎇␈F1        REQUIRE <procid> INITIALIZATION [<phase no>];
893⎇⎇␈F1where <phase no> is an integer constant.
894⎇⎇␈F1Semantics:
895⎇⎇␈F1<phase⎇no>⎇specifies⎇ the⎇number⎇ of⎇the⎇user⎇ initialization⎇phase.⎇ If⎇ it⎇is⎇left⎇out,⎇ then⎇one⎇is
896⎇⎇␈F1SAIL Addendum  1␈→819⎇243⎇1⎇0⎇⎇MISCELLANEOUS NEW FEATURES␈←
897⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16480⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
898⎇⎇␈F1used.⎇  Currently,⎇there⎇are⎇three⎇ phases,⎇numbered⎇0,⎇1,⎇and⎇ 2.⎇ If⎇the⎇ demand⎇is⎇great⎇enough,
899⎇⎇␈F1additional⎇phases⎇may⎇ be⎇added⎇later.⎇  (Note⎇for⎇assembly⎇ language⎇hackers:⎇internally,⎇user
900⎇⎇␈F1phases⎇are⎇numbered⎇'400000,⎇'400001,⎇etc.)
901⎇⎇␈F19.3⎇-⎇␈F2CHNCDB␈F1
902⎇⎇␈F1        val←CHNCDB(channel)
903⎇⎇␈F1This⎇integer⎇procedure⎇returns⎇a⎇pointer⎇to⎇the⎇three⎇word⎇block⎇used⎇to⎇open⎇the⎇ specified
904⎇⎇␈F1channel.⎇  It⎇is⎇provided⎇ for⎇the⎇benefit⎇ of⎇assembly⎇language⎇procedures⎇that⎇may⎇want⎇to⎇do
905⎇⎇␈F1I/O⎇inside⎇some⎇fast⎇inner⎇loop,⎇but⎇which⎇may⎇want⎇to⎇live⎇in⎇a⎇SAIL⎇core⎇image⎇&⎇use⎇the⎇SAIL
906⎇⎇␈F1OPEN,⎇etc.
907⎇⎇␈F1This⎇feature⎇does⎇not⎇work⎇in⎇TENEX⎇SAIL.⎇ See⎇a⎇hacker⎇if⎇you⎇want⎇these⎇features.
908⎇⎇␈F19.4⎇-⎇␈F2OVERFLOW␈F1
909⎇⎇␈F1The⎇overflow-underflow⎇handling⎇routines⎇have⎇been⎇upgraded⎇to⎇deal⎇with⎇JFCL⎇properly.⎇See
910⎇⎇␈F1the⎇section⎇on⎇trigonometric⎇routines.
911⎇⎇␈F19.5⎇-⎇␈F2ARRCLR␈F1
912⎇⎇␈F1        ARRCLR(arry)
913⎇⎇␈F1This⎇new⎇runtime⎇routine⎇clears⎇any⎇kind⎇of⎇array.⎇That⎇is,⎇arthmetic⎇arrays⎇get⎇filled⎇with⎇zeros,
914⎇⎇␈F1string⎇arrays⎇with⎇NULLs,⎇and⎇itemvar⎇arrays⎇with⎇ANYs.⎇ One⎇may⎇use⎇ARRCLR⎇with⎇set⎇and
915⎇⎇␈F1list⎇arrays,⎇but⎇the⎇set⎇and⎇list⎇space⎇will⎇be⎇lost⎇(i.e.⎇un-garbage-collectable).⎇The⎇alternative
916⎇⎇␈F1form:
917⎇⎇␈F1        ARRCLR(arry,val)
918⎇⎇␈F1where⎇val⎇is⎇either⎇an⎇integer⎇or⎇a⎇real⎇number,⎇will⎇fill⎇arry⎇with⎇that⎇value.⎇ Do⎇not⎇do⎇this⎇to
919⎇⎇␈F1string⎇or⎇list⎇arrays⎇unless⎇you⎇do⎇not⎇care⎇whether⎇or⎇not⎇your⎇program⎇works.⎇ Also⎇using⎇a
920⎇⎇␈F1SAIL Addendum  1␈→819⎇243⎇1⎇0⎇⎇MISCELLANEOUS NEW FEATURES␈←
921⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16484⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
922⎇⎇␈F1real⎇val⎇for⎇an⎇itemvar⎇array⎇is⎇apt⎇to⎇cause⎇strange⎇results.⎇(If⎇you⎇use⎇an⎇integer,⎇arry⎇will⎇be
923⎇⎇␈F1filled⎇with⎇CVI(val).)
924⎇⎇␈F19.6⎇-⎇␈F2SETPL␈F1
925⎇⎇␈F1        SETPL(channel, @linnum, @pagnum, @sosnum)
926⎇⎇␈F1This⎇new⎇runtime⎇routine⎇allows⎇one⎇to⎇keep⎇track⎇of⎇the⎇string⎇input⎇from⎇CHANNEL.
927⎇⎇␈F1Whenever⎇a⎇'12⎇is⎇encountered,⎇LINNUM⎇is⎇incremented.⎇ Whenever⎇a⎇'14⎇is⎇encountered,
928⎇⎇␈F1PAGNUM⎇is⎇incremented,⎇and⎇LINNUM⎇is⎇zeroed.⎇ Whenever⎇an⎇SOS⎇line⎇number⎇is⎇encountered,
929⎇⎇␈F1it⎇is⎇placed⎇into⎇SOSNUM.⎇ When⎇fully⎇implemented⎇(soon),⎇this⎇will⎇work⎇on⎇the⎇INPUT,⎇INTIN,
930⎇⎇␈F1and⎇REALIN⎇functions⎇as⎇well.
931⎇⎇␈F19.7⎇-⎇␈F2EVALREDEFINE␈F1
932⎇⎇␈F1EVALREDEFINE⎇bears⎇the⎇same⎇relationship⎇to⎇REDEFINE⎇as⎇EVALDEFINE⎇does⎇to⎇DEFINE.
933⎇⎇␈F1See⎇pages⎇47⎇and⎇50⎇of⎇the⎇Manual.
934⎇⎇␈F19.8⎇-⎇␈F2CVPS␈F1
935⎇⎇␈F1CVPS(<macro_parameter>)⎇converts⎇<macro_parameter>⎇to⎇a⎇string⎇and⎇returns⎇the⎇string.⎇See
936⎇⎇␈F1about⎇macro⎇parameters⎇on⎇page⎇48⎇of⎇the⎇manual.
937⎇⎇␈F19.9⎇-⎇␈F2EXPRESSIONS⎇IN⎇REQUIRES␈F1
938⎇⎇␈F1Previously,⎇all⎇REQUIRE⎇constructs⎇had⎇to⎇have⎇only⎇constants⎇in⎇them.⎇Now⎇SAIL⎇allows⎇compile
939⎇⎇␈F1time⎇expressions⎇as⎇well.⎇See⎇about⎇compile⎇time⎇expressions⎇on⎇page⎇47⎇of⎇the⎇Manual.
940⎇⎇␈F1SAIL Addendum  1␈→819⎇243⎇1⎇0⎇⎇MISCELLANEOUS NEW FEATURES␈←
941⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16489⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
942⎇⎇␈F19.10⎇-⎇␈F2RELEASE␈F1
943⎇⎇␈F1RELEASE⎇now⎇takes⎇an⎇optional⎇second⎇argument,⎇the⎇CLOSE⎇inhibit⎇bits.⎇ These⎇are⎇described⎇in
944⎇⎇␈F1the⎇UUO⎇manual⎇(Stanford⎇System).⎇These⎇are⎇defaulted⎇to⎇zero⎇when⎇not⎇specified⎇so⎇that⎇old
945⎇⎇␈F1programs⎇which⎇did⎇not⎇specify⎇them⎇will⎇work⎇as⎇before.
946⎇⎇␈F1The⎇CLOSE⎇inhibit⎇feature⎇only⎇works⎇at⎇SU-AI.
947⎇⎇␈F19.11⎇-⎇␈F2TTYUP␈F1
948⎇⎇␈F1        oldval←TTYUP(newval)
949⎇⎇␈F1This⎇routine⎇casuse⎇conversion⎇of⎇lower⎇case⎇characters⎇(a-z)⎇to⎇their⎇upper⎇case⎇equivalents⎇for
950⎇⎇␈F1strings⎇read⎇by⎇any⎇of⎇the⎇SAIL⎇teletype⎇routines⎇that⎇do⎇not⎇use⎇break⎇tables.⎇ If⎇newval⎇is
951⎇⎇␈F1TRUE,⎇then⎇conversion⎇will⎇take⎇place⎇on⎇all⎇subsequent⎇inputs⎇until⎇TTYUP⎇is⎇called⎇with⎇newval
952⎇⎇␈F1FALSE.⎇ Oldval⎇will⎇always⎇get⎇set⎇to⎇the⎇value⎇of⎇newval⎇used⎇in⎇the⎇previous⎇call.⎇(If⎇TTYUP
953⎇⎇␈F1has⎇never⎇been⎇called,⎇then⎇no⎇conversions⎇will⎇take⎇place,⎇and⎇the⎇first⎇call⎇to⎇TTYUP⎇will
954⎇⎇␈F1return⎇FALSE).
955⎇⎇␈F1In⎇TENEX,⎇TTYUP⎇sets⎇the⎇system⎇parameter⎇using⎇the⎇STPAR⎇jsys⎇to⎇convert⎇to⎇upper⎇case.
956⎇⎇␈F19.12⎇-⎇␈F2BREAKSET⎇MODES⎇"K"⎇AND⎇"F"␈F1
957⎇⎇␈F1A⎇"K"⎇specification⎇as⎇a⎇BREAKSET⎇mode⎇will⎇cause⎇lower⎇to⎇upper⎇case⎇conversion⎇when⎇that
958⎇⎇␈F1break⎇table⎇is⎇used.⎇ Conversion⎇takes⎇place⎇before⎇each⎇character⎇is⎇checked⎇for⎇breaking⎇or
959⎇⎇␈F1omission.⎇ An⎇"F"⎇specification⎇turns⎇off⎇the⎇conversion⎇--⎇i.e.⎇it⎇undoes⎇the⎇effects⎇of⎇"K".
960⎇⎇␈F1SAIL Addendum  1␈→819⎇243⎇1⎇0⎇⎇MISCELLANEOUS NEW FEATURES␈←
961⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16493⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
962⎇⎇␈F19.13⎇-⎇␈F2INOUT␈F1
963⎇⎇␈F1        INOUT(inchan,outchan,howmany)
964⎇⎇␈F1INOUT⎇reads⎇howmany⎇words⎇from⎇channel⎇inchan⎇and⎇writes⎇them⎇out⎇on⎇channel⎇outchan.⎇ Each
965⎇⎇␈F1channel⎇must⎇be⎇open⎇in⎇a⎇mode⎇between⎇8⎇and⎇12.⎇ on⎇return,⎇the⎇EOF⎇variables⎇for⎇the⎇two
966⎇⎇␈F1channels⎇will⎇be⎇the⎇same⎇as⎇if⎇ARRYIN⎇&⎇ARRYOUT⎇had⎇been⎇used.⎇ If⎇howmany⎇is⎇less⎇than
967⎇⎇␈F1zero,⎇then⎇transfer⎇of⎇data⎇will⎇cease⎇only⎇upon⎇end⎇of⎇file⎇or⎇a⎇device⎇error.
968⎇⎇␈F1(note:⎇INOUT⎇uses⎇BLTs⎇to⎇transfer⎇data⎇directly⎇from⎇one⎇set⎇of⎇buffers⎇to⎇the⎇other)
969⎇⎇␈F1INOUT⎇is⎇not⎇available⎇in⎇TENEX⎇SAIL.
970⎇⎇␈F19.14⎇-⎇␈F2GETSTS⎇&⎇SETSTS␈F1
971⎇⎇␈F1        SETSTS(chan,new_status)
972⎇⎇␈F1issues a SETSTS uuo on channel chan with the status value new_status.
973⎇⎇␈F1        status←GETSTS(chan)
974⎇⎇␈F1returns⎇the⎇results⎇of⎇a⎇GETSTS⎇uuo⎇on⎇channel⎇chan.
975⎇⎇␈F1These⎇functions⎇do⎇not⎇exist⎇in⎇TENEX⎇SAIL.⎇ Instead,⎇see⎇GTSTS,⎇GDSTS,⎇STSTS,⎇and⎇SDSTS
976⎇⎇␈F1for⎇analogous⎇features.
977⎇⎇␈F19.15⎇-⎇␈F2CHANGES⎇TO⎇"OPEN"⎇ERROR⎇HANDLING␈F1
978⎇⎇␈F1If⎇the⎇EOF⎇variable⎇supplied⎇to⎇OPEN⎇is⎇non-zero⎇and⎇the⎇device⎇name⎇is⎇invalid,⎇then⎇OPEN⎇will
979⎇⎇␈F1fail⎇without⎇giving⎇the⎇error⎇message⎇"INVALID⎇DEVICE⎇NAME⎇FOR⎇OPEN",⎇and⎇the⎇EOF⎇value
980⎇⎇␈F1will⎇be⎇unchanged.⎇ If⎇a⎇device⎇is⎇unavailable,⎇and⎇EOF=0,⎇then⎇the⎇user⎇is⎇now⎇given⎇the⎇options
981⎇⎇␈F1of⎇trying⎇again⎇or⎇going⎇on⎇without⎇opening⎇the⎇device,⎇in⎇which⎇case⎇EOF⎇will⎇be⎇set⎇to⎇non-
982⎇⎇␈F1zero⎇as⎇usual.
983⎇⎇␈F1SAIL Addendum  1␈→819⎇243⎇1⎇0⎇⎇MISCELLANEOUS NEW FEATURES␈←
984⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16497⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
985⎇⎇␈F19.16⎇-⎇␈F2ASH␈F1
986⎇⎇␈F1ASH⎇has⎇been⎇added⎇as⎇an⎇arithmetic⎇operator.⎇ Its⎇syntax⎇is⎇just⎇like⎇that⎇of⎇LSH,⎇and⎇it
987⎇⎇␈F1generates⎇similar⎇code⎇(except⎇for⎇putting⎇out⎇a⎇PDP-10⎇ASH⎇instruction⎇instead⎇of⎇a⎇LSH).
988⎇⎇␈F19.17⎇-⎇␈F2ARG_LIST␈F1
989⎇⎇␈F1        ARG_LIST(<arg1>,...,<argn>)
990⎇⎇␈F1where⎇each⎇<arg>⎇may⎇be⎇any⎇valid⎇argument⎇to⎇the⎇REF_ITEM⎇construct,⎇assembles⎇a⎇list⎇of
991⎇⎇␈F1"temporary"⎇reference⎇items⎇that⎇will⎇be⎇deleted⎇by⎇APPLY⎇after⎇the⎇applied⎇procedure⎇returns.
992⎇⎇␈F1Thus
993⎇⎇␈F1        APPLY(proc,ARG_LIST(foo,bar,VALUE baz))
994⎇⎇␈F1is roughly equivalent to
995⎇⎇␈F1        tmplst←{{REF_ITEM(foo),REF_ITEM(bar),REF_ITEM(VALUE baz)}};
996⎇⎇␈F1        APPLY(proc,tmplst);
997⎇⎇␈F1        WHILE LENGTH(tmplst) DO DELETE(LOP(tmplst));
998⎇⎇␈F1but⎇is⎇somewhat⎇easier⎇to⎇type.⎇ Note⎇that⎇the⎇reference⎇items⎇created⎇by⎇ARG_LIST⎇are⎇just
999⎇⎇␈F1like⎇those⎇created⎇by⎇REF_ITEM,⎇except⎇that⎇they⎇are⎇marked⎇so⎇that⎇APPLY⎇will⎇know⎇to⎇kill
1000⎇⎇␈F1them.
1001⎇⎇␈F19.18⎇-⎇␈F2CLOSE␈F1
1002⎇⎇␈F1The⎇CLOSE⎇function⎇now⎇has⎇an⎇additional⎇optional⎇argument⎇that⎇allows⎇the⎇CLOSE⎇inhibit⎇bits
1003⎇⎇␈F1to⎇be⎇turned⎇on.⎇ The⎇second⎇argument⎇is⎇the⎇bit⎇pattern⎇for⎇the⎇inhibition,⎇and⎇it⎇is⎇defaulted⎇0.
1004⎇⎇␈F1See⎇the⎇UUO⎇manual⎇for⎇details.
1005⎇⎇␈F1This⎇feature⎇is⎇available⎇only⎇at⎇SU-AI,⎇and⎇is⎇not⎇available⎇in⎇the⎇TENEX⎇version⎇of⎇SAIL.
1006⎇⎇␈F1SAIL Addendum  1␈→819⎇243⎇1⎇0⎇⎇MISCELLANEOUS NEW FEATURES␈←
1007⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16501⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
1008⎇⎇␈F19.19⎇-⎇␈F2TYPEIT␈F1
1009⎇⎇␈F1The⎇number⎇returned⎇by⎇the⎇TYPEIT⎇procedure⎇(which⎇identifies⎇the⎇type⎇of⎇the⎇datum⎇of⎇its
1010⎇⎇␈F1item⎇expression⎇argument)⎇is⎇now⎇changed⎇for⎇arrays.⎇ Now⎇it⎇is⎇'24⎇plus⎇the⎇scalar⎇value⎇of⎇the
1011⎇⎇␈F1type⎇(e.g.,⎇INTEGER),⎇whereas⎇before⎇it⎇was⎇'15⎇plus⎇the⎇scalar⎇value.
1012⎇⎇␈F1Additional⎇types⎇added⎇to⎇TYPEIT⎇are:⎇ '16⎇for⎇labels,⎇'17⎇for⎇record⎇classes.
1013⎇⎇␈F19.20⎇-⎇␈F2COMPARISON⎇OF⎇.REL⎇FILES␈F1
1014⎇⎇␈F1Starting⎇with⎇version⎇18,⎇the⎇compiler⎇emits⎇information⎇into⎇each⎇.REL⎇file⎇containing⎇the⎇version
1015⎇⎇␈F1of⎇the⎇compiler⎇used.⎇ Then,⎇during⎇the⎇SAIL⎇initialization⎇sequence,⎇these⎇versions⎇are⎇compared,
1016⎇⎇␈F1and⎇a⎇warning⎇message⎇is⎇issued⎇if⎇necessary.⎇ Thus,⎇the⎇problem⎇of⎇converting⎇from⎇one⎇version
1017⎇⎇␈F1of⎇the⎇compiler⎇to⎇a⎇new⎇version⎇is⎇lessened.⎇ This⎇feature⎇may⎇not⎇work⎇as⎇well⎇in⎇the⎇ current
1018⎇⎇␈F1changeover⎇as⎇it⎇will⎇in⎇the⎇future.
1019⎇⎇␈F19.21⎇-⎇␈F2SCAN⎇Optimizations␈F1
1020⎇⎇␈F1The⎇SCAN⎇function⎇has⎇been⎇modified⎇to⎇return⎇true⎇substrings⎇instead⎇of⎇copies⎇in⎇those⎇cases
1021⎇⎇␈F1that⎇the⎇break⎇table⎇in⎇question⎇was⎇not⎇omitting⎇any⎇characters.⎇ This⎇should⎇be⎇an⎇improvement
1022⎇⎇␈F1in⎇the⎇efficiency⎇of⎇those⎇routines.
1023⎇⎇␈F19.22⎇-⎇␈F2BREAK⎇TABLES␈F1
1024⎇⎇␈F1There⎇are⎇now⎇54⎇user-setable⎇break⎇tables⎇available⎇to⎇the⎇SCAN,⎇INPUT,⎇TTYINL⎇functions,⎇as
1025⎇⎇␈F1well⎇as⎇SETBREAK⎇and⎇BREAKSET.⎇ These⎇tables⎇are⎇allocated⎇and⎇deallocated⎇dynamically.
1026⎇⎇␈F1In⎇addition,⎇GETBREAK⎇now⎇returns⎇the⎇value⎇of⎇the⎇smallest⎇unallocated⎇breaktable,⎇and
1027⎇⎇␈F1RELBREAK⎇releases⎇its⎇table⎇argument.⎇ The⎇implicit⎇declarations⎇of⎇these⎇new⎇runtime⎇routines
1028⎇⎇␈F1are:
1029⎇⎇␈F1␈→824⎇0⎇2⎇0⎇⎇INTEGER PROCEDURE GETBREAK␈←
1030⎇⎇␈F1␈→715⎇0⎇2⎇0⎇⎇PROCEDURE RELBREAK(INTEGER TABLE)␈←
1031⎇⎇␈F1NOTE:⎇ a⎇breaktable⎇is⎇allocated⎇by⎇either⎇GETBREAK,⎇SETBREAK,⎇BREAKSET⎇or⎇STDBRK.⎇ A
1032⎇⎇␈F1SAIL Addendum  1␈→819⎇243⎇1⎇0⎇⎇MISCELLANEOUS NEW FEATURES␈←
1033⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16506⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
1034⎇⎇␈F1breaktable⎇is⎇de-allocated⎇(and⎇thereby⎇made⎇available⎇to⎇GETBREAK)⎇by⎇RELBREAK.
1035⎇⎇␈F1Breaktables⎇are⎇stored⎇in⎇groups⎇of⎇18,⎇so⎇it⎇is⎇more⎇efficient⎇to⎇use⎇all⎇the⎇tables⎇in⎇a⎇given
1036⎇⎇␈F1group⎇before⎇going⎇to⎇another⎇group.⎇ The⎇use⎇of⎇GETBREAK⎇is⎇particularly⎇recommended⎇for
1037⎇⎇␈F1load-modules⎇and⎇the⎇like,⎇so⎇that⎇conflicts⎇will⎇be⎇minimzed.⎇ Breaktable⎇zero⎇is⎇special.⎇ It⎇is
1038⎇⎇␈F1predeclared⎇to⎇produce⎇the⎇same⎇results⎇as⎇SETBREAK(0,NULL,NULL,"I").⎇ This⎇results⎇in⎇break-
1039⎇⎇␈F1on-count⎇for⎇calls⎇to⎇INPUT,⎇and⎇always⎇returns⎇the⎇whole⎇string⎇for⎇SCAN.⎇ Breaktable⎇zero⎇is
1040⎇⎇␈F1stored⎇along⎇with⎇breaktables⎇1⎇to⎇18,⎇and⎇thus⎇takes⎇up⎇no⎇additional⎇space.
1041⎇⎇␈F1HACKERS:⎇ Actually⎇there⎇are⎇17⎇additional⎇system⎇breaktables⎇which⎇are⎇reserved⎇for⎇use⎇by
1042⎇⎇␈F1the⎇SAIL⎇runtime⎇system.⎇ These⎇tables⎇are⎇numbers⎇-17⎇through⎇-1,⎇and⎇are⎇ordinarily⎇not
1043⎇⎇␈F1available⎇to⎇the⎇user.⎇ They⎇will⎇be⎇used⎇by⎇the⎇debugger⎇and⎇by⎇additional⎇SAIL⎇system⎇software.
1044⎇⎇␈F1The⎇user⎇can⎇obtain⎇access⎇to⎇breaktables⎇-17⎇through⎇-1⎇by⎇setting⎇BRKPRV(USER)⎇to⎇-1,⎇for
1045⎇⎇␈F1example⎇by⎇the⎇USERCON⎇function⎇which⎇accesses⎇the⎇SAIL⎇user⎇table.⎇ WARNING:⎇ absolutely
1046⎇⎇␈F1no⎇guarantees⎇are⎇made⎇to⎇the⎇user⎇who⎇accesses⎇these⎇breaktables.⎇ This⎇information⎇is⎇intended
1047⎇⎇␈F1for⎇completeness⎇only;⎇the⎇use⎇of⎇these⎇special⎇breaktables⎇by⎇the⎇user⎇is⎇not⎇recommended.
1048⎇⎇␈F19.23⎇-⎇␈F2CV6STR␈F1
1049⎇⎇␈F1CV6STR⎇does⎇what⎇you⎇always⎇wished⎇CVXSTR⎇did.⎇ I.e.,⎇it⎇stops⎇converting⎇as⎇soon⎇as⎇it⎇sees⎇a
1050⎇⎇␈F1blank⎇rather⎇than⎇always⎇returning⎇a⎇six-character⎇string.⎇ Example:
1051⎇⎇␈F1        CV6STR(CVSIX("XYZ"))="XYZ", not "XYZ   ".
1052⎇⎇␈F1Beware, however, since
1053⎇⎇␈F1        CV6STR(CVSIX("X Y Z")) ="X", not "X Y Z" or "XYZ".
1054⎇⎇␈F19.24⎇-⎇␈F2TENEX⎇RUNTIMES␈F1
1055⎇⎇␈F1The⎇TENEX⎇version⎇of⎇SAIL⎇now⎇has⎇these⎇additional⎇teletype-oriented⎇routines:⎇ STTYP,
1056⎇⎇␈F1GTTYP,⎇STPAR,⎇STI,⎇and⎇DELNF,⎇all⎇named⎇after⎇jsyses.⎇ See⎇TENEX-specific⎇documentation.
1057⎇⎇␈F1SAIL Addendum  1␈→819⎇243⎇1⎇0⎇⎇MISCELLANEOUS NEW FEATURES␈←
1058⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16509⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
1059⎇⎇␈F19.25⎇-⎇␈F2CVASTR␈F1
1060⎇⎇␈F1CVASTR⎇is⎇the⎇"correct"⎇inverse⎇function⎇to⎇CVASC.⎇ I.e.,⎇it⎇stops⎇on⎇a⎇null⎇character.⎇ For
1061⎇⎇␈F1instance,
1062⎇⎇␈F1        CVASTR(CVASC("ABC")) is "ABC"
1063⎇⎇␈F1whereas
1064⎇⎇␈F1        CVSTR(CVASC("ABC")) is "ABC"&0&0
1065⎇⎇␈F19.26⎇-⎇␈F2NEW⎇SWITCHES␈F1
1066⎇⎇␈F1/V⎇ forces⎇loader⎇link⎇blocks⎇and⎇constant⎇string⎇texts⎇into⎇the⎇low⎇segment;⎇intended⎇for
1067⎇⎇␈F1overlay⎇systems⎇in⎇which⎇code⎇is⎇overlaid⎇but⎇data⎇is⎇not.
1068⎇⎇␈F1/X⎇ controls⎇compiler⎇save/continue;⎇see⎇the⎇section⎇on⎇save/continue.
1069⎇⎇␈F1/W⎇ generates⎇additional⎇(suppressed)⎇DDT⎇symbols.⎇ These⎇symbols⎇are⎇designed⎇to⎇serve⎇as
1070⎇⎇␈F1comments⎇to⎇a⎇programmer⎇or⎇processor⎇rummaging⎇though⎇the⎇generated⎇code.⎇ Symbols
1071⎇⎇␈F1generated⎇by⎇this⎇switch⎇all⎇begin⎇with⎇a⎇percent⎇sign⎇(%),⎇and⎇many⎇come⎇in⎇pairs.⎇ A⎇%$⎇symbol
1072⎇⎇␈F1points⎇to⎇the⎇first⎇word⎇of⎇an⎇area⎇and⎇a⎇%.⎇symbol⎇points⎇to⎇the⎇first⎇word⎇beyond⎇the⎇area.
1073⎇⎇␈F1Thus⎇the⎇length⎇of⎇an⎇area⎇is⎇the⎇difference⎇of⎇its⎇%.⎇and⎇%$⎇symbols.⎇ The⎇symbols⎇are:
1074⎇⎇␈F1        %$ADCN  %.ADCN  address constant area
1075⎇⎇␈F1        %$LIT   %.LIT   literal area
1076⎇⎇␈F1        %$RLIT  %.RLIT  reference literal area
1077⎇⎇␈F1        %$SCOD  %.SCOD  START!CODE or QUICK!CODE area
1078⎇⎇␈F1        %$STRC  %$STRC  string variable area
1079⎇⎇␈F1        %$VARS  %.VARS  simple variable area
1080⎇⎇␈F1        %ALSTO          registers are about to be cleared
1081⎇⎇␈F1        %$ARRY          first data word of a fixed array
1082⎇⎇␈F1        %$FORE          FOREACH satisfier block
1083⎇⎇␈F1        %$SUCC          SUCCEED/FAIL return block
1084⎇⎇␈F1/W⎇tends⎇to⎇increase⎇the⎇number⎇of⎇DDT⎇symbols⎇by⎇a⎇factor⎇of⎇2⎇or⎇3.
1085⎇⎇␈F1/F⎇Two⎇new⎇values,⎇/40F⎇and⎇/100F,⎇have⎇been⎇added.⎇Characters⎇are⎇temporarily⎇inhibited⎇from
1086⎇⎇␈F1going⎇to⎇the⎇listing⎇file⎇if⎇the⎇40⎇bit⎇is⎇on⎇(see⎇COMPILER_SWITCHES⎇below⎇for⎇what⎇good⎇this
1087⎇⎇␈F1will⎇do⎇you).⎇ If⎇the⎇100⎇bit⎇is⎇on⎇then⎇the⎇two-line⎇banner⎇normally⎇put⎇at⎇the⎇top⎇of⎇each⎇page
1088⎇⎇␈F1of⎇the⎇listing⎇is⎇suppressed.⎇ Using⎇the⎇100⎇bit⎇is⎇a⎇way⎇to⎇have⎇SAIL⎇"permanently"⎇expand
1089⎇⎇␈F1macros;⎇a⎇/110F⎇listing⎇can⎇be⎇used⎇as⎇a⎇SAIL⎇source⎇file.
1090⎇⎇␈F1/D,⎇/P,⎇/Q,⎇/R⎇now⎇accept⎇values.⎇ If⎇a⎇non-zero⎇value⎇appears,⎇it⎇is⎇interpreted⎇as⎇decimal⎇and
1091⎇⎇␈F1SAIL Addendum  1␈→819⎇243⎇1⎇0⎇⎇MISCELLANEOUS NEW FEATURES␈←
1092⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16512⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
1093⎇⎇␈F1the⎇stack⎇is⎇set⎇to⎇that⎇size.⎇If⎇the⎇value⎇is⎇zero⎇or⎇absent,⎇then⎇the⎇stack⎇size⎇is⎇doubled⎇as
1094⎇⎇␈F1before.⎇ Thus⎇/35P/P⎇first⎇sets⎇the⎇P⎇stack⎇to⎇35⎇and⎇then⎇doubles⎇it⎇to⎇70.
1095⎇⎇␈F19.27⎇-⎇␈F2COMPILER_SWITCHES␈F1
1096⎇⎇␈F1The⎇statement⎇REQUIRE⎇"chars"⎇COMPILER_SWITCHES;⎇can⎇be⎇used⎇to⎇change⎇the⎇settings⎇of
1097⎇⎇␈F1the⎇compiler⎇switches.⎇ "chars"⎇must⎇be⎇a⎇string⎇constant⎇which⎇is⎇a⎇legitimate⎇switch⎇string,
1098⎇⎇␈F1containing⎇none⎇of⎇the⎇characters⎇"(/)";⎇e.g.,
1099⎇⎇␈F1    REQUIRE "20F" COMPILER_SWITCHES;
1100⎇⎇␈F1The⎇string⎇of⎇characters⎇is⎇merely⎇passed⎇to⎇the⎇switch⎇processor,⎇and⎇it⎇may⎇be⎇possible⎇to
1101⎇⎇␈F1cause⎇all⎇sorts⎇of⎇problems⎇depending⎇on⎇the⎇switches⎇you⎇try⎇to⎇modify.⎇ The⎇switches⎇which⎇set
1102⎇⎇␈F1stack⎇sizes⎇(D,⎇P,⎇Q,⎇R)⎇or⎇string⎇space⎇(S)⎇should⎇be⎇avoided.⎇Switches⎇which⎇control⎇the⎇format
1103⎇⎇␈F1of⎇files⎇(B,⎇F)⎇should⎇only⎇be⎇used⎇if⎇you⎇have⎇such⎇a⎇file⎇open.
1104⎇⎇␈F19.28⎇-⎇␈F2COMPILER_BANNER␈F1
1105⎇⎇␈F1This⎇is⎇a⎇predefined⎇macro⎇which⎇expands⎇to⎇a⎇string⎇constant⎇containing⎇the⎇text⎇of⎇the⎇two-line
1106⎇⎇␈F1banner⎇which⎇would⎇appear⎇at⎇the⎇top⎇of⎇the⎇current⎇page⎇if⎇a⎇listing⎇file⎇were⎇being⎇made.⎇ This
1107⎇⎇␈F1string⎇contains⎇the⎇date,⎇time,⎇name⎇and⎇page⎇of⎇the⎇source⎇file,⎇the⎇value⎇of⎇all⎇compiler⎇switches,
1108⎇⎇␈F1the⎇name⎇of⎇the⎇outer⎇block,⎇and⎇the⎇name⎇of⎇the⎇current⎇block.⎇ Thus⎇you⎇can⎇automatically
1109⎇⎇␈F1include⎇the⎇date⎇of⎇compilation⎇in⎇a⎇program⎇by⎇using⎇COMPILER_BANNER[n⎇TO⎇m]⎇for
1110⎇⎇␈F1appropriate⎇n⎇and⎇m.⎇Try⎇REQUIRE⎇COMPILER_BANNER⎇MESSAGE;⎇or⎇look⎇at⎇a⎇listing⎇for⎇the
1111⎇⎇␈F1exact⎇format.
1112⎇⎇␈F19.29⎇-⎇␈F2EDFILE␈F1
1113⎇⎇␈F1        EDFILE("filename",line,page,bits[0])
1114⎇⎇␈F1Exits⎇to⎇an⎇editor.⎇ Which⎇editor⎇is⎇determined⎇by⎇the⎇bits⎇which⎇are⎇on⎇in⎇the⎇second⎇parameter,
1115⎇⎇␈F1line⎇.⎇If⎇bit⎇0⎇or⎇bit⎇1⎇(600000,,0⎇bits)⎇is⎇on,⎇then⎇line⎇is⎇assumed⎇to⎇be⎇ASCID⎇and⎇SOS⎇is⎇called.⎇ If
1116⎇⎇␈F1neither⎇of⎇these⎇bits⎇is⎇on,⎇then⎇ line⎇ is⎇assumed⎇to⎇be⎇of⎇the⎇form⎇ attach⎇count,,sequential⎇line
1117⎇⎇␈F1number⎇and⎇E⎇is⎇called.⎇ Page⎇ is⎇the⎇binary⎇page⎇number.⎇ Bits⎇defaults⎇to⎇zero⎇and⎇controls⎇the
1118⎇⎇␈F1editing⎇mode:
1119⎇⎇␈F1            0  edit
1120⎇⎇␈F1            1  no directory (as in /N)
1121⎇⎇␈F1SAIL Addendum  1␈→819⎇243⎇1⎇0⎇⎇MISCELLANEOUS NEW FEATURES␈←
1122⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16516⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
1123⎇⎇␈F1            2  readonly (as in /R)
1124⎇⎇␈F1            4  create (as in /C)
1125⎇⎇␈F1In⎇addition,⎇the⎇accumulators⎇are⎇set⎇up⎇from⎇INIACS⎇(see⎇below)⎇so⎇that⎇the⎇E⎇command⎇αX⎇RUN
1126⎇⎇␈F1will⎇run⎇the⎇dump⎇file⎇from⎇which⎇the⎇current⎇program⎇was⎇gotten.⎇[Accumulators⎇0⎇(file⎇name),⎇1
1127⎇⎇␈F1(extention),⎇and⎇6⎇(device)⎇are⎇loaded⎇from⎇the⎇corresponding⎇values⎇in⎇INIACS.]
1128⎇⎇␈F19.30⎇-⎇␈F2INIACS␈F1
1129⎇⎇␈F1The⎇contents⎇of⎇locations⎇0-'17⎇are⎇saved⎇in⎇block⎇INIACS⎇when⎇the⎇core⎇image⎇is⎇started⎇for⎇the
1130⎇⎇␈F1first⎇time.⎇ Declare⎇INIACS⎇as⎇an⎇external⎇integer⎇and⎇use⎇START_CODE⎇or
1131⎇⎇␈F1MEMORY[LOCATION(⎇INIACS)+n]⎇to⎇reference⎇this⎇block.
1132⎇⎇␈F19.31⎇-⎇␈F2GOGTAB␈F1
1133⎇⎇␈F1Direct⎇access⎇to⎇the⎇user⎇table⎇can⎇be⎇gained⎇by⎇declaring⎇EXTERNAL⎇INTEGER⎇ARRAY
1134⎇⎇␈F1GOGTAB[0:n];⎇ The⎇clumsy⎇USERCON⎇linkage⎇is⎇obsolete.
1135⎇⎇␈F1The⎇symbolic⎇names⎇of⎇all⎇GOGTAB⎇entries⎇can⎇be⎇obtained⎇by⎇requiring⎇SYS:GOGTAB.DEF
1136⎇⎇␈F1(<SAIL>GOGTAB.DEF⎇on⎇TENEX)⎇as⎇a⎇source⎇file.⎇ This⎇file⎇contains⎇DEFINEs⎇for⎇all⎇of⎇the
1137⎇⎇␈F1user⎇table⎇entries.
1138⎇⎇␈F19.32⎇-⎇␈F2ARERR␈F1
1139⎇⎇␈F1The⎇effective⎇address⎇of⎇an⎇ARERR⎇UUO⎇(op⎇code⎇007)⎇may⎇be⎇either⎇word⎇1⎇or⎇word⎇2⎇of⎇a
1140⎇⎇␈F1string⎇descriptor.⎇ This⎇allows⎇ARERR⎇1,["array⎇name"]⎇from⎇START_CODE.
1141⎇⎇␈F1SAIL Addendum  1␈→819⎇243⎇1⎇0⎇⎇MISCELLANEOUS NEW FEATURES␈←
1142⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16520⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
1143⎇⎇␈F19.33⎇-⎇␈F2COORD␈F1
1144⎇⎇␈F1INTEGER PROCEDURE COORD(STRING LOCATION);
1145⎇⎇␈F1(A⎇ new⎇BAIL⎇feature).⎇ Returns⎇the⎇coordinate⎇number⎇of⎇the⎇location⎇given⎇as⎇its⎇argument.
1146⎇⎇␈F1LOCATION⎇has⎇the⎇same⎇syntax⎇as⎇in⎇BREAK.
1147⎇⎇␈F19.34⎇-⎇␈F2DEFAULT⎇PARAMETER⎇VALUES␈F1
1148⎇⎇␈F1Actually,⎇this⎇is⎇an⎇old⎇feature⎇which,⎇for⎇some⎇reason,⎇was⎇never⎇documented.⎇ The⎇SAIL
1149⎇⎇␈F1compiler⎇allows⎇you⎇to⎇specify⎇default⎇values⎇to⎇any⎇trailing⎇parameters.⎇ This⎇is⎇done⎇by
1150⎇⎇␈F1enclosing⎇the⎇desired⎇value⎇in⎇parentheses⎇following⎇the⎇parameter⎇declaration.⎇ For⎇instance,
1151⎇⎇␈F1        PROCEDURE FOO(REAL X;INTEGER I(2);STRING S("FOO");REAL Y(3.14159));
1152⎇⎇␈F1Then,⎇if⎇a⎇defaulted⎇parameter⎇is⎇left⎇out⎇of⎇a⎇procedure⎇call,⎇the⎇compiler⎇fills⎇in⎇the⎇default
1153⎇⎇␈F1automatically.⎇ Thus,⎇the⎇following⎇would⎇all⎇compile⎇the⎇same:
1154⎇⎇␈F1        FOO(A+B);
1155⎇⎇␈F1        FOO(A+B,2,"FOO");
1156⎇⎇␈F1        FOO(A+B,2,"FOO",3.14159);
1157⎇⎇␈F1Only⎇VALUE⎇parameters⎇may⎇be⎇defaulted,⎇and⎇the⎇default⎇values⎇must⎇all⎇be⎇recognized⎇by⎇the
1158⎇⎇␈F1SAIL⎇compiler⎇as⎇constants.⎇ Also,⎇you⎇cannot⎇leave⎇out⎇a⎇parameter⎇from⎇the⎇middle⎇of⎇the
1159⎇⎇␈F1parameter⎇list.⎇(I.e.,⎇FOO(A+B,,"BAR")⎇won't⎇work).⎇ Finally,⎇it⎇should⎇be⎇noted⎇that⎇the⎇compiled
1160⎇⎇␈F1code⎇assumes⎇that⎇all⎇parameters⎇are⎇actually⎇present⎇in⎇the⎇call,⎇so⎇be⎇careful⎇about⎇funny
1161⎇⎇␈F1START_CODE⎇or⎇INTERNAL-EXTERNAL⎇linkages.⎇ However,⎇APPLY⎇will⎇fill⎇in⎇default⎇values⎇if
1162⎇⎇␈F1not⎇enough⎇actual⎇parameters⎇are⎇supplied⎇in⎇an⎇interpreted⎇call.
1163⎇⎇␈F19.35⎇-⎇␈F2PRESET_WITH␈F1
1164⎇⎇␈F1(This⎇feature⎇has⎇also⎇been⎇around⎇for⎇a⎇while.)⎇PRESET_WITH⎇is⎇just⎇like⎇PRELOAD_WITH
1165⎇⎇␈F1except⎇that⎇an⎇array⎇which⎇is⎇PRESET⎇is⎇placed⎇in⎇the⎇upper⎇segment⎇if⎇the⎇/H⎇switch⎇was
1166⎇⎇␈F1specified⎇to⎇the⎇compiler.⎇ This⎇allows⎇constant⎇arrays⎇to⎇be⎇in⎇the⎇shared⎇portion⎇of⎇the⎇code.
1167⎇⎇␈F1SAIL Addendum  1␈→819⎇243⎇1⎇0⎇⎇MISCELLANEOUS NEW FEATURES␈←
1168⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16524⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
1169⎇⎇␈F19.36⎇-⎇␈F2RELATIONAL⎇OPERATORS␈F1
1170⎇⎇␈F1(This⎇feature⎇is⎇not⎇exactly⎇new,⎇either.)⎇ The⎇syntax⎇E1⎇RELOP1⎇E2⎇RELOP2⎇E3⎇where⎇E1,⎇E2,
1171⎇⎇␈F1and⎇E3⎇are⎇expressions⎇and⎇RELOP1,⎇RELOP2⎇are⎇relational⎇operators,⎇is⎇specially⎇interpreted⎇as
1172⎇⎇␈F1(E1⎇RELOP1⎇(T←E2))⎇AND⎇(T⎇RELOP2⎇E3).⎇ In⎇addition,⎇the⎇compiler⎇can⎇often⎇produce⎇better
1173⎇⎇␈F1code⎇when⎇the⎇special⎇syntax⎇is⎇used.⎇ Thus⎇a⎇bounds⎇check⎇may⎇be⎇written⎇IF⎇L<I<U⎇THEN⎇...⎇.
1174⎇⎇␈F1RELOP1⎇and⎇RELOP2⎇may⎇be⎇any⎇relational⎇operators,⎇and⎇need⎇not⎇be⎇in⎇transitive⎇order.⎇ The
1175⎇⎇␈F1code⎇IF⎇A<X>B⎇THEN⎇is⎇equivalent⎇to⎇IF⎇X>(A⎇MAX⎇B)⎇THEN⎇.
1176⎇⎇␈F19.37⎇-⎇␈F2SCANC␈F1
1177⎇⎇␈F1This⎇new⎇runtime⎇routine⎇is⎇equivalent⎇to⎇the⎇following⎇SAIL⎇code:
1178⎇⎇␈F1        STRING PROCEDURE SCANC(STRING ARG,BRK,OMIT,MODE);
1179⎇⎇␈F1        BEGIN "SCANC" INTEGER TBL,BRCHAR; STRING RSLT;
1180⎇⎇␈F1        TBL←GETBREAK; SETBREAK(TBL,BRK,OMIT,MODE);
1181⎇⎇␈F1        RSLT←SCAN(ARG,TBL,BRCHAR);
1182⎇⎇␈F1        RELBREAK(TBL);
1183⎇⎇␈F1        RETURN(RSLT) END "SCANC";
1184⎇⎇␈F1Note⎇that⎇the⎇arguments⎇are⎇all⎇value⎇parameters,⎇so⎇that⎇SCANC⎇will⎇be⎇called⎇at⎇compile⎇time⎇if
1185⎇⎇␈F1the⎇arguments⎇are⎇constants.⎇ It⎇is⎇intended⎇that⎇SCANC⎇be⎇used⎇with⎇ASSIGNC⎇in⎇macros⎇and
1186⎇⎇␈F1conditional⎇compilation.⎇ For⎇scanning⎇at⎇execution⎇time,⎇it⎇is⎇much⎇more⎇efficient⎇to⎇use⎇SCAN
1187⎇⎇␈F1directly.
1188⎇⎇␈F19.38⎇-⎇␈F2TMPIN⎇and⎇TMPOUT␈F1
1189⎇⎇␈F1        str←TMPIN("tmpcor filename", @errflag)
1190⎇⎇␈F1        TMPOUT("tmpcor filename", "string", @errflag)
1191⎇⎇␈F1These⎇routines⎇do⎇input⎇and⎇output⎇to⎇tmpcor⎇files⎇(simulated⎇files⎇kept⎇in⎇core⎇storage--cf.⎇UUO
1192⎇⎇␈F1manual).
1193⎇⎇␈F1TMPIN⎇returns⎇a⎇string⎇consisting⎇of⎇the⎇entire⎇contents⎇of⎇the⎇tmpcor⎇file⎇of⎇the⎇specified⎇name.
1194⎇⎇␈F1This⎇name⎇should⎇be⎇no⎇more⎇than⎇three⎇characters⎇long;⎇characters⎇in⎇the⎇name⎇after⎇the⎇first
1195⎇⎇␈F1three⎇are⎇ignored.⎇ If⎇the⎇input⎇fails⎇for⎇some⎇reason⎇(most⎇likely:⎇ no⎇tmpcor⎇file⎇with⎇the
1196⎇⎇␈F1specified⎇name),⎇errflag⎇is⎇set⎇to⎇true⎇and⎇the⎇null⎇string⎇is⎇returned.⎇ Otherwise⎇errflag⎇is⎇set⎇to
1197⎇⎇␈F1false.
1198⎇⎇␈F1TMPOUT⎇writes⎇its⎇string⎇argument⎇into⎇the⎇specified⎇tmpcor⎇file.⎇ The⎇errflag⎇has⎇the⎇same
1199⎇⎇␈F1SAIL Addendum  1␈→819⎇243⎇1⎇0⎇⎇MISCELLANEOUS NEW FEATURES␈←
1200⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16528⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
1201⎇⎇␈F1function⎇as⎇in⎇TMPIN;⎇in⎇case⎇of⎇error,⎇the⎇tmpcor⎇file⎇is⎇not⎇written.⎇ Likely⎇causes⎇for⎇error
1202⎇⎇␈F1are⎇running⎇out⎇of⎇tmpcor⎇space⎇(currently,⎇the⎇sum⎇of⎇the⎇sizes⎇of⎇all⎇the⎇tmpcor⎇files⎇for⎇a
1203⎇⎇␈F1single⎇job⎇may⎇not⎇exceed⎇=256⎇words)⎇or⎇attempting⎇to⎇write⎇a⎇null⎇tmpcor⎇file⎇(i.e.⎇calling
1204⎇⎇␈F1TMPOUT⎇with⎇the⎇string⎇argument⎇null).
1205⎇⎇␈F1TMPIN⎇executes⎇a⎇TMPCOR⎇uuo⎇with⎇code⎇1,⎇and⎇hence⎇does⎇not⎇delete⎇the⎇specified⎇tmpcor⎇file.
1206⎇⎇␈F1The⎇length⎇of⎇the⎇returned⎇string⎇will⎇always⎇be⎇a⎇multiple⎇of⎇five,⎇since⎇words⎇rather⎇than
1207⎇⎇␈F1characters⎇are⎇actually⎇being⎇transferred.⎇ TMPOUT⎇executes⎇a⎇TMPCOR⎇uuo⎇with⎇code⎇3.⎇ The
1208⎇⎇␈F1last⎇word⎇of⎇the⎇string⎇is⎇padded⎇with⎇nulls⎇if⎇necessary⎇before⎇the⎇data⎇transfer⎇is⎇done.
1209⎇⎇␈F1Neither⎇function⎇is⎇available⎇in⎇TENEX⎇SAIL.
1210⎇⎇␈F1␈→1050⎇0⎇2⎇0⎇⎇␈F2SECTION  10␈F1␈←
1211⎇⎇␈F1SAIL Addendum  1␈→805⎇243⎇1⎇0⎇⎇MINOR CORRECTIONS TO AIM-204␈←
1212⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16529⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
1213⎇⎇␈F1␈→621⎇0⎇2⎇0⎇⎇␈F2MINOR CORRECTIONS TO AIM-204␈F1␈←
1214⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇␈←
1215⎇⎇␈F1␈F4This⎇is⎇a⎇file⎇of⎇known⎇SAIL⎇manual⎇defects⎇(mainly⎇typos)⎇that⎇are⎇not
1216⎇⎇␈F4already⎇noted⎇in⎇the⎇preface⎇or⎇covered⎇by⎇the⎇"incremental"⎇SAIL
1217⎇⎇␈F4manual.⎇ It⎇is⎇primarily⎇an⎇internal⎇document⎇for⎇the⎇SAIL⎇hackers,⎇put
1218⎇⎇␈F4is⎇being⎇provided⎇here⎇as⎇a⎇stopgap⎇measure⎇pending⎇a⎇full⎇new⎇edition
1219⎇⎇␈F4for⎇the⎇manual.⎇ This⎇list⎇is,⎇however,⎇not⎇complete⎇in⎇that⎇it⎇does⎇not
1220⎇⎇␈F4include⎇a⎇number⎇of⎇typos⎇that⎇do⎇not⎇change⎇the⎇meaning.⎇ If,⎇however,
1221⎇⎇␈F4you⎇discover⎇any⎇defects⎇in⎇the⎇manual⎇or⎇in⎇the⎇update,⎇please⎇notify
1222⎇⎇␈F4your⎇friendly⎇local⎇SAIL⎇representative.
1223⎇⎇␈F499R     KVL     The synonym for "SUCH THAT" is "|" and not "␈↓"␈↑
1224⎇⎇␈F432R     KVL     APPENDIX 5 has nothing to do with the
1225⎇⎇␈F4                bits for IO errors or mode enablings
1226⎇⎇␈F443L     RHT     FILEINFO documentation is a lie.  You usually get:
1227⎇⎇␈F4                FILENAME
1228⎇⎇␈F4                EXT,,DATE
1229⎇⎇␈F4                prot(9)Mode(4)time(11)date(12)
1230⎇⎇␈F4                negative swapped word count (if did a lookup).
1231⎇⎇␈F4                0  (unless you opened device in magic mode)
1232⎇⎇␈F4                0
1233⎇⎇␈F4                The whole point is that what you get is the six words
1234⎇⎇␈F4                from the last lookup or enter.  For details see the
1235⎇⎇␈F4                monitor manual.
1236⎇⎇␈F458R     JRL     if a designated bracketed triple is not found
1237⎇⎇␈F4                then bindit is returned and no error message is given
1238⎇⎇␈F433L     JRL     release now takes a second defaultable value integer
1239⎇⎇␈F4                argument, the close inhibit bits (see RELEAS in UUO
1240⎇⎇␈F4                manual).  These are defaulted to zero when
1241⎇⎇␈F4                unspecified.
1242⎇⎇␈F472R     KVL     TELLALL does not do an implicit RESCHEDULE as the
1243⎇⎇␈F4                description implies -- it just sets the status of
1244⎇⎇␈F4                the concerned processes to "ready".
1245⎇⎇␈F4102R    RFS     "33 through 36" S/B "33 through 35"
1246⎇⎇␈F4105R    RFS     ". her are several"    s/b " . There are several"
1247⎇⎇␈F1SAIL Addendum  1␈→805⎇243⎇1⎇0⎇⎇MINOR CORRECTIONS TO AIM-204␈←
1248⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16531⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
1249⎇⎇␈F479R,L   KVL     JOBTPC should be loaded with the location of a CALL
1250⎇⎇␈F4                to a non-simple procedure.
1251⎇⎇␈F492R     JRL     20F will in future surround macro expansions with
1252⎇⎇␈F4                "<>" not "⊂⊃".
1253⎇⎇␈F438R     RHT     The description of INCHWL is wrong.  Actually, the
1254⎇⎇␈F4                activation character is never included in the string
1255⎇⎇␈F4                and is always put into _SKIP_.  (<crlf> puts a <cr>
1256⎇⎇␈F4                into _SKIP_ & throws away the <lf>).
1257⎇⎇␈F424L     RHT     The compiler will not in fact turn division by a
1258⎇⎇␈F4                power of two into an ASH.
1259⎇⎇␈F490L     REG     "... See section 19 about these [compilation errors]"
1260⎇⎇␈F4                should be section 20.
1261⎇⎇␈F490L     REG     19.1.3 "boundary" is misspelled.
1262⎇⎇␈F441R     RHT     CVSIX left-justifies the sixbit value it builds.
1263⎇⎇␈F443L     RHT     In POINT, it is "a PDP-10 byte pointer".
1264⎇⎇␈F445R     RHT     FORC syntax should be "FORC <identifier> ← ... "
1265⎇⎇␈F457R     RHT     " ... methods of searching the associative store ..."
1266⎇⎇␈F4                had "store" missing before.
1267⎇⎇␈F4105L    RHT     "omaname" should be "the symbolic name"
1268⎇⎇␈F4110L    RHT     added reference:
1269⎇⎇␈F4                Harvey, Brian  "Monitor Command Manual" SAILON 54.3
1270⎇⎇␈F4                (Dec 1973)
1271⎇⎇␈F4                Also, there is a more current SOS manual: SAILON 50.3
1272⎇⎇␈F476L     RHT     Should be "REF_ITEM(VALUE <expression>)"
1273⎇⎇␈F443L     RFS     For FILEINFO, also should have a note to export users
1274⎇⎇␈F4                like "FILEINFO fills the array with the results of
1275⎇⎇␈F4                the last LOOKUP or ENTER (DEC 10-50 systems).
1276⎇⎇␈F4                Consult your local monitor manual for the format of
1277⎇⎇␈F4                these entries."
1278⎇⎇␈F428L     JRL     CALLING PROCEDURES FROM INSIDE CODE BLOCKS
1279⎇⎇␈F4                "... procedure is typed, it will return is value in
1280⎇⎇␈F4                AC 1 (a pointer to the second word if the procedure
1281⎇⎇␈F4                is a string procedure)." should be " procedure is
1282⎇⎇␈F4                typed and not a string procedure it will return
1283⎇⎇␈F4                its value in AC 1. String procedures push the two
1284⎇⎇␈F4                word string descriptor corresponding to the result
1285⎇⎇␈F4                on the SP stack."
1286⎇⎇␈F1SAIL Addendum  1␈→805⎇243⎇1⎇0⎇⎇MINOR CORRECTIONS TO AIM-204␈←
1287⎇⎇␈F1␈→1296⎇0⎇2⎇0⎇⎇16532⎇␈←␈→1296⎇647⎇1⎇0⎇⎇␈←
1288⎇⎇␈F423L     RHT     The table of precedence for  ∧ & ∨ is misleading.
1289⎇⎇␈F4                ∧ has higher precedence than ∨.
1290⎇⎇␈F426R     JRL     ARRYIN. No indication of how many words were actually
1291⎇⎇␈F4                read is given if EOF is encountered while reading a
1292⎇⎇␈F4                file in DUMP mode.
1293⎇⎇␈F425L     RHT     The description of the MEMORY[x,<type>] construct is
1294⎇⎇␈F4                very misleading.  There is no restriction on the use
1295⎇⎇␈F4                of this construct as the left hand side of an
1296⎇⎇␈F4                assignment statement.  In fact, MEMORY[x,<type>] may
1297⎇⎇␈F4                be used anywhere a simple variable of type <type> may
1298⎇⎇␈F4                be used.
1299⎇⎇␈F492R     JFR     The compiler is initialized with /7F.
1300⎇⎇␈F499L     JFR     In Appendix 3, the entry "STRBRK" should be "STDBRK".